乔丹50岁扣篮:C#主函数

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/05 05:06:25
今天编程时出现了错误
错误提示为找不到合适的主程序,哪位高手能帮帮忙啊?!
急!!!!

//athlongyj的解答不完全正确,Main应该包含在一个类当中,并且整个程序只能有
//一个Main函数,且要是static型的,而且M要大写.正确的如下:
using System;
using System.Collections.Generic;
using System.Text;

namespace HelloWorld
{
class Program //Main要包含在类当中
{
static void Main(string[] args)
{
}
}
}

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

同意楼上,在C#中,一切东西都是属于类的。