Practice Exams for Windows

Practice Exams for Windows

Tuesday, 14 April 2009

Introduction to C#

  • C# is case sensitive
  • To compile programs manually, use csc.exe
  • Use csc.exe -help for detailed help on the C# compiler
  • The basic programming method is:
  • ○ Namespace.class.method();
  • All statements end with a semi-colon
  • Single-line comments are used preceded with two forward slashes //
The Main Method
  • The Main Method is what is executed when the program is run
  • The Main Method is often referred to as the "entry point"
  • A "static" modifier precedes the Main method. The static modifier is necessary for the Main method. It means the Main method works in this class only, rather than an instance of the class
  • Every Method must have a return type
  • Every Method must have a set of parentheses with zero or more parameters in the parentheses


  1. I tried to learn VB.Net a while ago, but never really had the patience... I think after I finish my server exams, maybe I'll pick up Windows Powershell and then either the basics of C# or VB.Net to compliment my scripting skills.

  2. Yep, I'm only learning the basics. After I studied Powershell V1, I found myself having to use more and more of the .NET framework from within Powershell to achieve the best functionality, so it felt only natural to look into the .NET programming languages.

    The C# syntax is the closest to Powershell with the only key differences (I've found) being case sensitivity and type delcarations.