.exe 不包含适用于入口点的静态“Main”方法。
为此,我转到应用程序选项卡上的项目属性,然后启动对象,但它告诉我它没有设置,我无法像 frmMain 一样进入我的程序。
如何在启动对象上输入我的程序?
请您参考如下方法:
创建一个新的源代码文件(也许将其命名为“Program.cs”)。在该文件中,插入如下内容:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("* Press Any Key to Exit *");
Console.ReadKey();
}
}
}
