Beginners C# Tutorial
This lesson will get you started with C# by introducing a few very simple programs. Here are the objectives of this lesson:
. Understand the basic structure of a C# program.
. Obtain a basic familiarization of what a “Namespace” is.
. Obtain a basic understanding of what a Class is.
. Learn what a Main method does.
. Learn how to obtain command-line input.
. Learn about console input/output (I/O).
…
The program in Listing 1-1 has 4 primary elements, a namespace declaration, a class, a Main method, and a program statement. It can be compiled with the following command line:
csc Welcome.cs
This produces a file named Welcome.exe, which can then be executed. Other programs can be compiled similarly by substituting their file name instead of Welcome.cs. For more help about command line options, type “csc -help” on the command line. The file name and the class name can be totally different.
Note for VS.NET Users: The screen will run and close quickly when launching this program from Visual Studio .NET. To prevent this add the following code as the last line in the Main method:
…
Website: www.freewebs.com | Filesize: 83kb
No of Page(s): 6
Click here to download Beginners C# Tutorial.
Related Tutorial
Tags: .NET, basic, basic knowledge
Comments
Leave a Reply




