北京安通林JIS系统
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.

55 lines
1.3 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 Stone.Common;
using System.Threading;
namespace Stone.WinService
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
try
{
Gm_WMS.DataAccess.DataService.LocalDBService.m_conn = MyAppconfig.ReadValue("LocalDB");
F_EDI_BJ.IsRun = true;
Thread t1 = new Thread(F_EDI_BJ.Run);
t1.Start();
MyLogger.Write("服务启动成功!");
}
catch (Exception ex)
{
MyLogger.Write("服务启动失败,原因为:" + ex.Message);
}
}
protected override void OnStop()
{
try
{
F_EDI_BJ.IsRun = false;
MyLogger.Write("服务停止成功!");
}
catch (Exception ex)
{
MyLogger.Write("服务停止失败!详细原因为:" + ex.Message);
}
}
}
}