//athlongyj的解答不完全正确,Main应该包含在一个类当中,并且整个程序只能有
//一个Main函数,且要是static型的,而且M要大写.正确的如下:
using System;
using System.Collections.Generic;
using System.Text;
namespace HelloWorld
{
class Program //Main要包含在类当中
{
static void Main(string[] args)
{
}
}
}
///
/// 应用程序的主入口点。
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
同意楼上,在C#中,一切东西都是属于类的。