




































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





































Some key terms Introduce the C# programming language for the VB developer Mention some important features of the Visual Studio .NET environment Pass along some editing tips and tricks
Object – A class instance. Once an object has been created from its class, it’s possible to call methods and read and write properties Objects are created when a class’ constructor is called
Everything is the same as VB Solution file, project file, program files
Modules have a file suffix of .cs instead of .vb
In C#, all statements end with a semicolon ; Statements can span multiple lines There is no need for a continuation character as in VB Example C# System.Console.WriteLine( “This is a line of text”); Example VB System.Console.WriteLine( _ “This is a line of text”);
XMLSummary comments begin with /// Single line comments are marked with // Multi-line comments start with /* and end with */
// A comment.
/ This is Also a comment /
C# VB int Integer bool Boolean string String double Double float Single date DateTime
Dim Count As Integer Dim MyName As String = “Ekedahl”
int count; string MyName = “Ekedahl”;
Use the System.String data type as in VB; The C# string type maps to System.String the string concatenation operator is + instead of & The members are the same between C# and VB
In IS 350, you used val to convert strings to numbers In C#, val is used to declare implicitly typed variables We will use a much different strategy here Each primary data type supports a method named TryParse The method accepts 2 arguments The string to parse The output result
Members of System.Convert class also convert one type to another System.Convert.ToInt System.Convert.ToDouble System.Convert.ToDateTime …
Constants are just variables whose value does not ever change Declare with the const statement Constants can only be initialized when they are declared
Access modifiers control the scope of a procedure or variable The keywords are the same between VB and C# private – scope is the class containing the procedure or variable public – scope is global
In VB, blocks are marked with keywords Sub – End Sub If – End If Do Loop While End While In C#, blocks are all marked with {} as in Java or C++