C# Programming
Introduction:
C# is modern , general purpose , object-oriented programming language developed by
Microsoft.
C# was developed by Anders Hejlsberg and his team during the development of .Net
Framework.
C# is designed for Common Language Infrastructure (CLI), which consist of executable
code and runtime environment that allows use of various high-level languages on di erent
computer platforms and architectures.
Important features of C# are as follows:
1. Boolean Conditions
2. Automatic Garbage Collection
3. Standard Library
4. Assembly Versioning
5. Properties and Events
6. Delegates and Events Management
7. Easy-To-Use-Generics
8. Indexes
9. Conditional Computation
10. Simple Multithreading
11. LINQ and Lambda Expressions
12. Integration with Windows
The .Net Framework
The .Net framework is a revolutionary platform that helps you to write the following types
of applications −
• Windows applications
• Web applications
• Web services
The .Net framework consists of an enormous library of codes used by the client
languages such as C#. Following are some of the components of the .Net framework −
• Common Language Runtime (CLR)
• The .Net Framework Class Library
• Common Language Speci cation
• Common Type System
• Metadata and Assemblies
• Windows Forms
• ASP.Net and ASP.Net AJAX
fi
ff
• ADO.Net
• Windows Work ow Foundation (WF)
• Windows Presentation Foundation
• Windows Communication Foundation (WCF)
• LINQ
Coding In C#
A C# program consists of the following parts −
• Namespace declaration
• A class
• Class methods
• Class attributes
• A Main method
• Statements and Expressions
• Comments
Example:
using System;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
/* my rst program in C# */
Console.WriteLine("Hello World");
Console.ReadKey();
}
fi
fl