Exemplo n.º 1
0
 /// <summary>
 /// 应用程序的主入口点。
 /// </summary>
 static void Main()
 {
     QuartzManaer.GetInstance().StartQuartz();
     //ServiceBase[] ServicesToRun;
     //ServicesToRun = new ServiceBase[]
     //{
     //    new StatusService()
     //};
     //ServiceBase.Run(ServicesToRun);
 }
Exemplo n.º 2
0
        protected override void OnStart(string[] args)
        {
            try
            {
                LogHelper.WriteInfo(typeof(OrderStatusService), "服务OnStart函数开始执行");
                QuartzManaer.GetInstance().StartQuartz();
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(typeof(OrderStatusService), "OnStart", Engineer.ccc, null, ex);
                var sc = new ServiceController("WineGameService");
                if (sc.Status == ServiceControllerStatus.Running)
                {
                    sc.Stop();
                    sc.WaitForStatus(ServiceControllerStatus.Stopped);
                }
                sc.Start();
                sc.WaitForStatus(ServiceControllerStatus.Running);

                LogHelper.WriteLog(typeof(OrderStatusService), "OnStart", Engineer.ccc, new { Status = sc.Status }, ex);
            }
            LogHelper.WriteInfo(typeof(OrderStatusService), "服务WineGameService函数:OnStart执行结束");
        }
Exemplo n.º 3
0
        protected override void OnStart(string[] args)
        {
            try
            {
                LogHelper.Info("服务OnStart函数开始执行");
                QuartzManaer.GetInstance().StartQuartz();
            }
            catch (Exception ex)
            {
                LogHelper.Error("OnStart", ex);
                var sc = new ServiceController("QuartzShowGoodsService");
                if (sc.Status == ServiceControllerStatus.Running)
                {
                    sc.Stop();
                    sc.WaitForStatus(ServiceControllerStatus.Stopped);
                }
                sc.Start();
                sc.WaitForStatus(ServiceControllerStatus.Running);

                LogHelper.Error("OnStart", ex);
            }
            LogHelper.Info("服务WineGameService函数:OnStart执行结束");
        }