出错提示:不包含适合于入口点的静态“Main”方法

问题描述

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Net.Sockets;usingSystem.Runtime.Serialization.Formatters.Binary;usingSystem.Net;usingSystem.Collections;namespaceLogin{publicpartialclassfrmLogin:DevComponents.DotNetBar.Office2007Form{publicNetworkStream_ns=null;//网络流publicintMyAccounts;//登录者的帐号publicintportNum;//登录者监听的端口号publicfrmLogin(intportNum){InitializeComponent();this.portNum=portNum;}privatevoid登录框_Load(objectsender,EventArgse){}privatevoidbutLogin_Click_1(objectsender,EventArgse){if(this.textUserID.Text.Trim()==""){this.balloonTip1.SetBalloonCaption(this.textUserID,"提示");this.balloonTip1.SetBalloonText(this.textUserID,"请输入用户名。");this.balloonTip1.ShowBalloon(this.textUserID);return;}if(this.textPassword.Text.Trim()==""){this.balloonTip1.SetBalloonCaption(this.textPassword,"提示");this.balloonTip1.SetBalloonText(this.textPassword,"请输入密码。");this.balloonTip1.ShowBalloon(this.textPassword);return;}stringstrIP=Dns.Resolve(Dns.GetHostName()).AddressList[0].ToString();//连接服务器TcpClient_serverSocket=newTcpClient(strIP,8888);//获取网络流this._ns=_serverSocket.GetStream();LoginUserInfoVO.LoginUserInfouserInfo=newLoginUserInfoVO.LoginUserInfo();try{this.MyAccounts=int.Parse(this.textUserID.Text.Trim());userInfo.LoginAccounts=this.MyAccounts;userInfo.PortNum=this.portNum;}catch{MessageBox.Show("帐号必须为数字~!");}userInfo.LoginPassWord=this.textPassword.Text;//获得本机的IP地址userInfo.LoginIP=Dns.Resolve(Dns.GetHostName()).AddressList[0].ToString();userInfo.Flag="Login";//格式器BinaryFormatterformater=newBinaryFormatter();//把对客户端对象序列化到流中formater.Serialize(this._ns,userInfo);//从流中反序列化对象LoginUserInfoVO.LoginUserInforeturnUser=(LoginUserInfoVO.LoginUserInfo)formater.Deserialize(this._ns);//判断帐号是否正确if(returnUser.LoginState==1){MessageBox.Show("密码或帐号错误~!!");return;}if(returnUser.LoginState==0){//开启主界面Form2main=newForm2(this,returnUser.AryFellowList,this.portNum);//开启广播通知frmWelcomeTipwelcome=newfrmWelcomeTip();welcome.labTitleAccounts.Text="系统消息:";welcome.labWelcomeWord.Text=this.textUserID.Text+"n您好!欢迎您的登录~!";welcome.Show();main.Show();//this.Hide();}}privatevoidbutCancel_Click(objectsender,EventArgse){this.Close();}privatevoidtextUserID_KeyDown_1(objectsender,KeyEventArgse){if(e.KeyCode==System.Windows.Forms.Keys.Enter)this.textPassword.Focus();}privatevoidtextPassword_KeyDown_1(objectsender,KeyEventArgse){if(e.KeyCode==System.Windows.Forms.Keys.Enter)this.butLogin.Focus();}//注册帐号的链接privatevoidlinkLabel1_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){frmRegisterregister=newfrmRegister();register.ShowDialog();}}}提示错误7程序“C:DocumentsandSettingsAdministrator桌面Login918LoginobjDebugLogin.exe”不包含适合于入口点的静态“Main”方法Login

解决方案

解决方案二:
这是说你的整个项目内的所有文件中没有一个类里有一个静态方法签名符合Main函数的要求。
解决方案三:
xuexue~~~~~~~~~~~~~~
解决方案四:
咋解决

时间: 2024-09-05 07:23:26

出错提示:不包含适合于入口点的静态“Main”方法的相关文章

c#函数 纠错-运行时提示错误“不包含适合于入口点的静态“Main”方法”,怎么解决?

问题描述 运行时提示错误"不包含适合于入口点的静态"Main"方法",怎么解决? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.IO; using System.Configuration; namespace ConsoleApplication4 { /// /// 根

XX类库 不包含适合于入口点的静态“Main”方法

错误 1  程序"XXX\Client\Client.Model\obj\x86\Debug\Client.Model.exe"不包含适合于入口点的静态"Main"方法 Client.Model 原因:原来创建项目的时候,用的是"空项目",我以为这样就会生成类库,实际上,一开始准备运行的时候,就会提示以上错误. 解决方式:1.右键点类库属性 2.然后在输出类型选择"类库" 作者:kissazi2  出处:http://www.

程序不包含适合于入口点的静态“Main”方法

问题描述 usingSystem;namespacemyprogram{classprogram{voidPrintNums(){Console.WriteLine("123");Console.WriteLine("213.0");}}}这是我对着教材打的代码,为什么会有如标题的错误 解决方案 解决方案二:你把那个staticMain(string[]args){}给加上解决方案三:staticvoidMain(string[]args){} 漏了个void解决方

程序定义了多个入口点。使用 /main (指定包含入口点的类型)进行编译

原文:请使用/main进行编译,以指定包含入口点类型     在使用VS工具初学C#的时候需要不停的写小程序,觉得每次都新建项目太过麻烦,所以试着把程序写在一个项目下面,结果编译的时候出错了,因为我每个小程序都使用的Main()方法,而VS的提示信息虽然看得懂原因,却不明白要怎么做,后来查阅MSDN得到解决办法,在此与跟我有同样疑惑的人分享:     解决办法:     VS界面点击:项目-->XX属性-->应用程序  在此页有一个启动对象属性设置成你想启动的那个类名就可以了.     另外:

出错提示为:该行已经属于另一个表 的解决方法

DataTable dt = new DataTable(); dt = ds.Tables["All"].Clone();//把All的结构传递给dt DataRow[] dr=this.dataSet31.Tables["Product"].Select("bc=1"); for(int i=0;i<dr.Length;i++) { //将数组元素加入表... dt.Rows.Add(dr[i]);//出错提示为:该行已经属于另一个表

关于实时错误453:找不到DLL入口点

经过前几天的艰苦奋斗,我们的作品"飞聊"的基本功能已经实现,从现在开始进入窗口美化.调试.打包等阶段. 不过今天上午问题又来了,在给窗体实现换肤功能的时候,虽然添加了模块(其中也已经调用声明了相应的API),窗体中也添加了相应的代码,但在运行时弹出了 "实时错误'453':找不到DLL入口点SkinH_AttachEx in SkinH_VB6.dll"的对话框.如下图:   其实遇到这种问题,很可能是调用的函数与系统接口的问题,我在换肤的模块中声明的函数为: Pu

如何为WPF添加Main()函数 程序入口点的修改

一般的.WPF的Main()函数是自动生成的,不过有时候我们需要为我们的应用程序传参.那么自动生成的Main()函数就不会满足我们的要求.那么如何为WPF Application 设置Main()函数呢. 1.新建一个WPF项目 2.添加一个Program.cs类,代码如下: using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace WpfApplication1{st

wince平台 嵌入式编程开发 无法在coredll.dll中找到FindWinow的入口点

问题描述 用vs2008搭建了wince平台进行手持终端开发,在WindowsCE5.0Emulator部署调试的时候出现"MissingManifestResourceException"错误,刚开始没有搭建wince平台时候运行exe文件或者调试提示"无法在coredll.dll中找到FindWinow的入口点".困扰了几天了--请大家帮忙解决,谢谢!!! 解决方案 本帖最后由 u013250515 于 2014-01-08 15:04:17 编辑解决方案二:模

Android程序的入口点

原文:Android程序的入口点     android应用程序,由一到多个Activity组成.每个Activity没有很紧密的联系,因为我们可以在自己的程序中调用其它Activity,特别是调用自己的代码之外生成的Activity,比如android提供的发短信或者打电话的Activity.         Intent call = new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+phonenumber);         start