CgwMonitorManage.Service.Program.StartService C# (CSharp) Method

StartService() static private method

开启服务函数
static private StartService ( ) : void
return void
        static void StartService()
        {
            MonitorManageService inist = MonitorManageService.Instance();
            ServiceHost host = new ServiceHost(inist);
            inist.SetHost(host);
            host.Opened += delegate
            {
                NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
                Thread dbConnectionThread = new Thread(new ThreadStart(LoadMonitorTimer_Elapsed));
                dbConnectionThread.Start();
                logEx.Info("Enter: Start CgwMonitorManage.Service");
            };
            host.Open();
            ServiceBase.Run(inist);
        }