













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!














Compilation and execution of programs
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
.NET applications use the Common Language Runtime (CLR) and are executed as Managed Code Libraries are stored in framework classes Your code and framework classes are executed by the CLR
Classes encapsulate functionality and have methods, properties (object orientation) Classes implement interfaces See Figure 1.
System.dll defines the primary data types System.Data.dll defines the components that make up ADO.NET System.Drawing.dll contains the components used to draw various shapes to an output device Forms and printers are output devices System.Windows.Forms.dll contains components to implement desktop forms System.XML.dll used to process XML documents
System namespace contains fundamental classes System.Data namespace contains classes supplying data access capabilities ADO.NET System.Drawing provides access to the Graphical Device Interface allowing shapes to be drawn to forms and printers System.IO provides access to files System.Windows.Forms supplies the capabilities to create forms and control instances on those forms
By default, you must fully qualify class and method names System.IO.StreamReader for example In VB, the Imports statement allows unqualified references Imports System.IO In C#, it’s the using statement using System.IO;
Everything is the same as VB Solution file, project file, program files Namespace references
Modules have a file suffix of .cs instead of .vb Application startup works a bit differently VB uses a form or Sub Main C# has a “special” procedure named Main()
Create a new C# Console project
using statements replace Imports statement
namespace blocks contain classes, which contain properties and methods
The Main() method is called the entry point It’s where program execution begins Must be declared as static Method can return either a void or an int