且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Client.exe'不包含适用于入口点的静态"Main"方法

更新时间:2023-11-13 18:54:16

控制台/Windows应用程序需要入口点.在Web应用程序/网站中,将出现启动页面/登录页面将是入口点.

因此,任何一个类文件(如果有多个类文件)都必须有静态的"Main"方法.
在您的班级中添加以下代码,您的应用程序将运行
Console/Windows Application requires entry point. Where as in web application/web site, there will be start up page/Login page will be entry point.

So, there must be static "Main" method in any one of class file (if you have multiple class files).
Add below code in your class, your application will work
static void Main(string[] args){
     //call your method
 }


每个控制台应用程序都应具有一个入口点来执行该应用程序.在C#中,它是通过Main方法定义的.因此,您需要包含一个方法名称为"main"的方法,并且可能不是完美的语法跟随者.

例如:请在类中添加以下代码.
Each and every console application should have an entry point to execute the application. In C# it is defined by Main method. So you need to include a method which has a method name as "main" and may not be a perfect syntax follower.

For example: Please add the following code inside the the class.
static void Main()
{
   client.Connect("server name", "message");
}



HTH,
Sham _



HTH,
Sham_