新建类HelloWorld.cs,内容如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MyApp.test
{
public class HelloWorld
{
static void Main(string[] args)//main函数是C#的接入口!
{
/* 我的第一个 C# 程序 */
Console.WriteLine("Hello World!");//这个一句输出语句!
Console.ReadKey();//这个语句为了防止输出窗口一跳而过!
}
}
}
按F5运行
如果在项目开发里,想要进行一些小测试,不想写在类里面的话,可以在窗口—右键—交互执行,在下面开启交互执行的窗口,如下图所示
有点类似命令执行窗口,可以进行快速地运行一些小模块测试