16 April, 2012

First program using visual studio 2010


Hopefully you have already installed visual studio 2010. If you didn’t install yet, Install Visual Studio 2010 Step by Step.

So, let’s try to write our first program in visual studio 2010.

Step 1: Click Start -> Program -> Microsoft Visual Studio 2010 -> Microsoft Visual Studio 2010.










Step 2: If you open Visual Studio 2010 first time after installation in your computer. You will see the following screen. Select Visual C# Development Settings and click Start Visual Studio. We have selected Visual C# Development Settings because we will work with C#.



































Step 3: After Clicking Start Visual Studio at previous steps you will see the following screen. Click File -> New -> Project..










Step 4: Select Console Application among the projects. Note that I have changed my project location and Project name. You can keep default location and name.


Step 5:  Now you will see the following screen where you will develop your first program. You will see default code snippet which comes automatically.



Default code snippet:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyFirstProgram
{
    class Program
    {
        static void Main(string[] args)
        {
           
        }
    }
}


Add a simple statement in the Main Method:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyFirstProgram
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("This is my first program in C#");
        }
    }
}




Step 6: Click Debug -> Start Without Debugging or Press – Ctrl+F5. You will see the following screen.


Yes! You have done! This is your first program in C#. Happy programming!!!

No comments:

Post a Comment