♣ Start –> Programs –> Microsoft Visual Studio 2010
♣ This process will open Visual studio .net IDE
♣ IDE means integrating development environment
♣ Click on new project link, it will open new project window
♣ Here select language as C# and select type of application as console application
♣ Rename it as MyConsole application next location as D Drive and click on OK button
♣ With this process it will create a new console application and it will open new console application development environment.
♣ To open visual studio .net we have one shortcut like below
♣ Start –> Run –>”devenv”-> click OK
♣ With this process it will open visual studio IDE
♣ Console application development application will have mainly two windows
1. Code Window
2. Solution Explorer Window
Solution Explorer Window :
♣ This window will have all the project related files, it is coming with one important file called “program.cs”
Program.cs:
♣ It is a C#.net class file that means every C#.net class file extension will be .cs and VB.net class file extension will be .vb
Class File :
♣ Class file can contain collection of classes, by default every C#.net class file will come with a single click but a class file can contain multiple classes
♣ Program.cs class file is coming with a single class called program and this program class is coming with a method called “main” method.
Main Method :
♣ Main is a special type of function, console application program execution starts by main method and execution is controlling by main method and execution stops by main method
♣ But main method is also controlling by .net execution engine called CLR.
Code Window :
♣ This windows will display the selected class file structure of Skelton code.
♣ By default console application will have only one class file, due to that reason console application code window will display the program.cs skeleton.
Structure of Program.cs :
using System;
using System.Collections.Generic;
using System.Linq; // -->Base Class libraries
using System.Text;
namespace ConsoleApplication1 // --> Applicatin Name
{
class Program // --> Class Name
{
static void Main(string[] args) // --> Method Name
{
// Method Block
} // --> Method Block Closing
} // --> Class Block Closing
} // --> Application Block Closing