A program consists of English-language instructions called source code . The syntax for these instructions is strictly defined by the language.Source code consists of a series of statements. A statement is an instruction to the complier. Each instruction must be formed correctly, and one task you'll face when learning C# will be to learn the correct syntax of the language. For example, in C#, every statement ends with a semicolon.Each instruction has a semantic meaning that expresses what you are trying to accomplish.
Compiling your source code means running a compiler and identifying the source code file. You run the compiler by opening a command prompt (DOS box) and entering the program name csc. Compiler is to turn your source code into a working program. It turns out to be just slightly more complicated than that because .NET uses an intermediate language called Microsoft Intermediate Language (MSIL, sometimes abbreviated as IL).The compiler reads your source code and produces IL. When you run the program, the .NET Just In Time (JIT) compiler reads your IL code and produces an executable application in memory. The IL code is actually stored in a .exe file, but this file does not contain executable code. It contains the information needed by the JIT to execute the code when you run it.
Simple source code file :
namespace NotePad
{
class HelloWorld
{
// every console app starts with Main
static void Main( )
{
System.Console.WriteLine("Hello world!");
}
}
}
The C# language to develop four types of applications:
-Console applications, which display no graphics
A console application runs in a console window
-Windows applications, which use the standard Windows interface
A Windows application runs on a PC's desktop
-Web applications, which can be accessed with a browser
An ASP.NET application runs on a web server and delivers its functionality through a browser
-Web services, which can be accessed using standard Internet protocols and which provide services such as current stock quotes, ISBN to title conversions, etc., that can be used by other applications