.net Wand
.net used for magic
Browse by Tags
All Tags
»
C#
(
RSS
)
.net
tips
Webclient downloading content/files from an Https (SSL)
Monday, October 05, 2009 2:09 AM
i was using the webclient object to download files from a website and my application worked fine. my client decided to add an SSL certeficate to the website and has required me to change my code to request the file through https instead of http all i had to do was change the URL to have https:// instead of http:// but when i first tried the code. i got this exception...
Read More...
Yield in c#
Monday, February 25, 2008 3:47 AM
i've been trying to explain the keyword yield to a friend of mine for more than an hour and he did not get it. but finally when i typed in this example he finally did 1: class enu :IEnumerable 2: { 3: public IEnumerator GetEnumerator() 4: { 5: yield return 1; 6: yield return 2; 7: yield return 3; 8: } 9: } it actually means that when you are enumerating this...
Read More...
Delegates to LINQ [passing logic as a parameter] (part I)
Friday, February 08, 2008 9:03 AM
it's normal to pass data to a function just thow in a parameter of the type of data you want to pass and ur set public int add ( int i, int u ){ return i+u; } now think in a different way, u now want to build a set of operations that the user can choose from now what you need is to build a function that would take the user's input and the operation as...
Read More...
Have u ever needed to extend a string? [Extension Methods]
Thursday, December 27, 2007 6:34 AM
well it's not inheritable by default so you can not extend it. that used to be the case before c# 3.0 now you can specify all the functionality that you need in an Extension Method. problem lies in that the extension method needs to access the instance of the object you are extending well, it goes like this 1- first you declare a static class with ur static...
Read More...
Object and Collection Initializers
Wednesday, December 26, 2007 5:03 AM
well also one of the nicest features in c# 3.0 is the object initializers well we used to do this 1: Employee emp = new Employee(); 2: emp.FirstName= "Amir" ; 3: emp.LastName= "Magdy" ; 4: emp.Title = "Mr." ; i actually hated writing this previous snippet now in c# 3.0 we do this 1: var emp = new Employee {FirstName= "Amir"...
Read More...
Auto Implemented Properties
Monday, December 24, 2007 2:23 AM
C# 3 comes with a very nice feature (not undermining the power of lambda expressions and Linq), just this one shows how nice the language has evolved into 1: class Employee 2: { 3: public string firstName { get; set; } 4: } you see the previous code will act as a full blown property that maintains its instance value internally the compiler creates a member and...
Read More...
Go
This Blog
Home
Contact
Links
About
Tags
.net
ajajx.net
Ajax
asp.net
C#
code generation
debug
free books
fun
IIS
industry news
javascript
open source
software engineering
source control
SQL Server
tips
tools
VBs
vs.net
web services
WebControls
Navigation
Home
Blogs
Forums
Archives
February 2010 (1)
January 2010 (1)
October 2009 (1)
August 2009 (1)
July 2009 (1)
June 2009 (2)
May 2009 (4)
April 2009 (1)
March 2009 (2)
February 2009 (1)
November 2008 (1)
September 2008 (1)
August 2008 (2)
March 2008 (4)
February 2008 (2)
December 2007 (13)
November 2007 (16)
Web 2.0 stuff
Syndication
RSS
Receive Email Updates
Subscribe