Sunday, May 15, 2016

First Console Application - C# -VS 2010

It is long back to document the Dotnet --Let us start now,  and the AIM  is  -to take  a simple Timesheet Web Applicaiton Step by Step.....in this journey

Menu Navigatino :
  1. Start Visual Studio.
  2. On the menu bar, choose FileNewProject.
    The New Project dialog box opens.
  3. Expand Installed, expand Templates, expand Visual C#, and then choose Console Application.
  4. In the Name box, specify a name for your project, and then choose the OK button.
    The new project appears in Solution Explorer.
  5. If Program.cs isn't open in the Code Editor, open the shortcut menu for Program.cs in Solution Explorer, and then choose View Code.
your  codes looks like below :


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

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter Your Name, Please");
            String sname = Console.ReadLine();
            Console.WriteLine("hello ,"+ sname);
            Console.WriteLine("Please enter a key to continue''''''''");
            Console.Read();



        }
    }
}


-------Press  F5  ---------To Run the Application

You will get first screen something like below :

Now enter your name :  Then you will get below screen

Thats all.....you have done....with your very first application.

C#  --is  case sensitive  not like forms where you can use mixed .
Example : Writeline is wrong and WriteLine  is correct.


--------------------------------------------------------------------------------------
With Divine Blessing....Happy Journey.........

No comments:

Post a Comment