自各儿用C#写的服务意外终止
自己用C#写的服务意外终止
自己用C#的服务运行一会就意外终止了,为什么??
日志中只有log_import_service 服務意外地終止。
代码如下:
protected override void OnStart(string[] args)
{
System.Threading.Timer m_timer = null;
System.Threading.Timer m_timer2 = null;
System.Threading.Timer m_timer3 = null;
System.Threading.Timer m_timer4 = null;
try
{
m_timer = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback), null, 0, 4 * 1000);
}
catch
{
}
try
{
m_timer2 = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback2), null, 0, 7 * 1000);
}
catch
{
}
try
{
m_timer3 = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback3), null, 0, 11 * 1000);
}
catch
{
}
try
{
m_timer4 = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback4), null, 0, 17 * 1000);
}
catch
{
}
}
protected override void OnStop()
{
}
public void timerCallback(object status)
{
string sql = "update ate.xx_mail set mail='11111111111111' where num='100'";
OracleHelp.HExeNonquery(CommandType.Text, sql);
}
public void timerCallback2(object status)
{
string sql = "update ate.xx_mail set mail='2222222222222222' where num='100'";
OracleHelp.HExeNonquery(CommandType.Text, sql);
}
public void timerCallback3(object status)
{
string sql = "update ate.xx_mail set mail='3333333333333333333' where num='100'";
OracleHelp.HExeNonquery(CommandType.Text, sql);
}
public void timerCallback4(object status)
{
string sql = "update ate.xx_mail set mail='44444444444444444444' where num='100'";
自己用C#的服务运行一会就意外终止了,为什么??
日志中只有log_import_service 服務意外地終止。
代码如下:
protected override void OnStart(string[] args)
{
System.Threading.Timer m_timer = null;
System.Threading.Timer m_timer2 = null;
System.Threading.Timer m_timer3 = null;
System.Threading.Timer m_timer4 = null;
try
{
m_timer = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback), null, 0, 4 * 1000);
}
catch
{
}
try
{
m_timer2 = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback2), null, 0, 7 * 1000);
}
catch
{
}
try
{
m_timer3 = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback3), null, 0, 11 * 1000);
}
catch
{
}
try
{
m_timer4 = new System.Threading.Timer(new System.Threading.TimerCallback(timerCallback4), null, 0, 17 * 1000);
}
catch
{
}
}
protected override void OnStop()
{
}
public void timerCallback(object status)
{
string sql = "update ate.xx_mail set mail='11111111111111' where num='100'";
OracleHelp.HExeNonquery(CommandType.Text, sql);
}
public void timerCallback2(object status)
{
string sql = "update ate.xx_mail set mail='2222222222222222' where num='100'";
OracleHelp.HExeNonquery(CommandType.Text, sql);
}
public void timerCallback3(object status)
{
string sql = "update ate.xx_mail set mail='3333333333333333333' where num='100'";
OracleHelp.HExeNonquery(CommandType.Text, sql);
}
public void timerCallback4(object status)
{
string sql = "update ate.xx_mail set mail='44444444444444444444' where num='100'";