C# and VB Equivalents
VB:
'shorthand object constructors; assigned initial properties
dim p as New Person() With {.FirstName = "john", .LastName="smith"}
'add handler for events
AddHandler context.BeginRequest, AddressOf Applicaton_BeginRequest
C#:
//shorthand object constructors; assigned initial properties
Person p = new Person() with {FirstName = "john", LastName="smith"}
//add handler for events
context.BeginRequest += Application_BeginRequest;
Posted on February 21, 2011, in Programming & Development and tagged .net, .net 2.0, .net 3, .net 3.0, .net 3.5, .net 4, .net 4.0, asp, c#, csharp, equivalents, net 2, vb, vb .net. Bookmark the permalink. Leave a Comment.
Leave a Comment
Comments (0)