VisualStudio2010 创建C#应用程序----输出“hello world”

1.打开Visual Studio 2010,选择“文件”——“新建”——“项目”菜单命令。调出“新建项目”对话框。

VisualStudio2010 创建C#应用程序----输出“hello world”

 2.在“新建项目”对话框右侧的列表中选择“控制台应用程序”选项,在“名称"中输入项目名称,设置”位置“,其余默认,最后单击”确定“。

VisualStudio2010 创建C#应用程序----输出“hello world”

3.在Visual Studio 2010的资源管理器中双击Program.cs,打开Program.cs文件,编写代码。 

VisualStudio2010 创建C#应用程序----输出“hello world”

代码如下:

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            Console.ReadKey();

        }
    }
}
 

4.选择"调试“——”启动调试“菜单命令,启动调试过程。或者直接按”F5“键。

5.若无错误,则弹出程序运行结果窗口。

 

VisualStudio2010 创建C#应用程序----输出“hello world”

 

 出现的问题:

       调试中出现对话框“无权限运行”之类的提示信息,是杀毒软件阻挡了一些权限,修改权限之后,可以正常输出hello world。