Asp.net

Part #1:

Topic: Start with asp.net C#


You have to install visual studio in your pc. 
Download Visual Studio from: Download Visual Studio.

Install Guideline : Install Visual Studio 


First programming 'Hello World'

1. Open 'Visual Studio' click on 'New Project' then select 'Console Application' name the application as 'HelloWrold' and select your folder path


2. Write the following code into the 'Program' class
   
      static void Main(string[] args)
        {
            Console.WriteLine("Hello Wrold!");
            Console.ReadKey();
        } 

3. Build your solution


4. Now start your application to click 'Start' on top bar.


This is your first app on c#.....Thank you.




Part #2:
Topic : Take value form user and show.

Today we will write a program which able to get data from user and when execute the program it take data from user and the data value will show at console.

Select a new project the select console application and project name like 'IOApp'. Then OK.
Write the following code in to the program class-

        static void Main(string[] args)
        {
            Console.Write("Enter your name: ");
            string input=Console.ReadLine();
            Console.WriteLine("Your name is: "+input);
            Console.ReadKey();
        }


Now build and run your solution.

Enter your name: Code All Time

Press Enter

Your name is: Code All Time

Note: In c# language to get data use Console.Read and to display data use Console.Write

No comments:

Post a Comment