First article
University began to learn the C # language, and then work to do is related to the development. Flash is 5 years, also did not become Daniel, feel in C # is still a rookie.
To start your program career in the first program, 工欲善其事 its prerequisite, so you need to install Visual Studio, and other languages compared to C # development tools is quite good, not like Java has a lot of development tools, A headache for a novice who wants to get into the programming world. For installation and version selection, install Visual Studio 2008, 2010, 2015 or other versions can be, how to install can Baidu Visual Studio installation tutorial can see a lot of many, here do not write. Download the installation package you can go to the official Microsoft website, or from MSDN, I tell you (I generally download from here, in addition to this site there are many other Microsoft product installation package, General people I do not tell him)
The development environment for this article is visual Studio 2015
Well, before we get ready, we start the first program, "Hello, World"
To create and run a console application
1. Start Visual Studio.
2. On the menu bar, choose File, New, project.
3. The New Project dialog box opens. Such as
4. Expand installed, expand Templates, expand Visual C #, and then select Console Application.
5. In the Name box, specify the project name, and then select the OK button.
6. The new project appears in Solution Explorer.
7. If Program.cs is not open in the Code Editor, double-click Program.cs in Solution Explorer on the right. Such as
8. Replace the contents of Program.cs with the following code.
Using System;namespace helloworld{ class Program { //Hello, World-Novice's first procedure static void Main (string[] args) { Console.WriteLine ("Hello, World"); Keep the console window open in debug mode. Console.WriteLine ("Any key exit"); Console.readkey ();}}}
9. F5 key to run the project, congratulations on your program career from this "Hello, the World" opened.
Comments:
Main method
A C # console application must contain a Main method that is used for the start and end of the control program. Create objects and perform other methods in the Main method.
Hello, world-the first program for newbies