You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.6 KiB
64 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.ServiceProcess;
|
|
using System.Text;
|
|
using Gm_WMS.DataAccess.DataService;
|
|
using Stone.User;
|
|
using Stone.WinBiz.JISAdmin;
|
|
using System.Threading;
|
|
using Stone.Common;
|
|
|
|
namespace Stone.WinService
|
|
{
|
|
public partial class Service1 : ServiceBase
|
|
{
|
|
public Service1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnStart(string[] args)
|
|
{
|
|
try
|
|
{
|
|
LocalDBService.m_conn = MyAppconfig.ReadValue("LocalDB");
|
|
|
|
|
|
F_EDI_JIS5000Sequence.IsRun = true;
|
|
Thread t1 = new Thread(F_EDI_JIS5000Sequence.Run);
|
|
t1.Start();
|
|
|
|
|
|
//F_Continuous.IsRun = true;
|
|
//Thread t2 = new Thread(F_Continuous.Run);
|
|
//t2.Start();
|
|
|
|
MyLogger.Write("服务启动成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyLogger.Write("服务启动失败!详细原因为:" + ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
protected override void OnStop()
|
|
{
|
|
try
|
|
{
|
|
F_EDI_JIS5000Sequence.IsRun = false;
|
|
F_Continuous.IsRun = false;
|
|
|
|
MyLogger.Write("服务停止成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyLogger.Write("服务停止失败!详细原因为:" + ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|