Sometimes fresher's face much problem in created their first application. We are here to develop a first console application with screen shots using C# of VS 2005.
Lets go though this process step by step:
Step 1: Open VS 2005 and click on File –> New –> Projects
Step 2: Select project type as Visual c# and Templates as console Application
step 3: New Project is created.
Step 4: Lets write few lines of code.
I have written two lines in program.CS file inside the main method. Console.Write is used to print the given line on the screen. Console.ReadLine is used to read line from screen. we are using Console.ReadLine here to stop the output screen until press any key. if you will remove this line the output screen will disappear.
Console.Write("This is my First Console Application");
Console.ReadLine();
You can add a extra file in this application also by
Right Click on MyFirstConsoleApp –> Add –> New item –> Select a Type of File and give the name of file and click on ok button.
Step 5: Now lets run the application by pressing F5 button or click the below button.
Step 6: Output of above program is here.
Source code:
using System;
using System.Collections.Generic;
using System.Text;
namespace MyFirstConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.Write("This is my First Console Application");
Console.ReadLine();
}
}
}
Congrats you have created first program and run it, Please let us know in case of any problems.
0 comments:
Post a Comment