07-12-2010
2. Solution Explorer: Solution Explorer is representing the project related files. This window has two important files:
a. Assembly info.cs: This file is representing complete information about the assemblies. We will use this file when we working with assemblies.
b. Program.cs: C#.Net class file extension will be ".cs"
VB.Net class file extension will be .VB
Class file can be contain collection of classes
Program.cs file is a C#.Net class file it is coming with a single class called program
Praogram class is representing with a method called main method.
Eg: To print a friendly Message:
namespace consoleapplication1
{
class program
{
void main(---)
{
Console.WriteLine(" Good Evening ")
Console.ReadLine();
}
}
}
Output: Good Evening
Console Class: Console is a pre-defined class definig by the microsoft.
WriteLine(): WriteLine() is apredefined member method of console class. This method wil print the given value on command prompt window after printing the value it wil move the cursor to next line.
Class Console
{
WriteLine()
{
}
}
In this above program we have last statement has Console.readLine. here, ReadLine is a member method of console class which is holding the output window until user will press an enter key.
In all the console application programs last statement shgould be console.ReadLine
Eg: To display 3 messages:
void main(---)
{
Console.WriteLine("Welcome to C#.Net");
Console.WriteLine("Welcome to console application");
Console.WriteLine("Welcome to Sathya Technologies");
Console.ReadLine();
}
Output: Welcome to C#.Net
Welcome to Console application
Welcome to Satya Technologies