[视觉工作室 2008]
我为控制台应用程序创建了一个新项目并将其修改为如下所示:
class Program
{
static void Main (string[] args) {
Thread.Sleep (2000);
}
}
然后我为 Windows 窗体应用程序创建了另一个项目并对其进行了修改:
static class Program
{
//[STAThread] commented this line
static void Main (string[] args) { //Added args
//Commented following lines
//Application.EnableVisualStyles ();
//Application.SetCompatibleTextRenderingDefault (false);
//Application.Run (new Form1 ()); commented this line
Thread.Sleep (2000);
}
}
现在我既没有在第一个应用程序中编写控制台功能(Console.Write 等),也没有在第二个应用程序中编写与表单相关的操作。长得跟我一模一样。
第一个应用程序仍然显示黑色窗口,第二个应用程序不显示任何内容。是什么让它这样工作?