Hello, world-the first program for newbies

Source: Internet
Author: User
Tags microsoft website

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.