C#写的windows服务 不定时自动关闭谁知道什么原因
功能很简单就是接受客户端的用户名和密码然后决定是否登录成功系统日志的提示:Application:login3.exeFrameworkVersion:v4.0.3031...
功能很简单就是接受客户端的用户名和密码然后决定是否登录成功
系统日志的提示:
Application: login3.exe Framework Version: v4.0.30319 Description: The process
was terminated due to an unhandled exception. Exception Info: System.Exception
Stack: at login3.Service1.loginhandle() at
System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object) at
System.Threading.ThreadHelper.ThreadStart()
系统服务里的方法
protected override void OnStart(string[] args)
{
EventLog.WriteEntry("ERP登录服务启动--用力过猛");
if (t1 == null)
{
t1 = new Thread(new ThreadStart(loginhandle));
}
t1.Start();
t1.IsBackground = true;
}
protected override void OnStop()
{
if (t1 != null)
{
if (t1.ThreadState == System.Threading.ThreadState.Running)
{
t1.Abort();
}
}
EventLog.WriteEntry("我的服务停止");
}
public static void loginhandle()
{
。。。。。。。。。
//监听tcpclient查询数据库返回登录结果。。。
} 展开
系统日志的提示:
Application: login3.exe Framework Version: v4.0.30319 Description: The process
was terminated due to an unhandled exception. Exception Info: System.Exception
Stack: at login3.Service1.loginhandle() at
System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object) at
System.Threading.ThreadHelper.ThreadStart()
系统服务里的方法
protected override void OnStart(string[] args)
{
EventLog.WriteEntry("ERP登录服务启动--用力过猛");
if (t1 == null)
{
t1 = new Thread(new ThreadStart(loginhandle));
}
t1.Start();
t1.IsBackground = true;
}
protected override void OnStop()
{
if (t1 != null)
{
if (t1.ThreadState == System.Threading.ThreadState.Running)
{
t1.Abort();
}
}
EventLog.WriteEntry("我的服务停止");
}
public static void loginhandle()
{
。。。。。。。。。
//监听tcpclient查询数据库返回登录结果。。。
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询