public static ServiceControllerStatus GetServiceState(ServiceUnit service)
 {
     using (var sc = new ServiceController(service.ServiceName))
     {
         return sc.Status;
     }
 }
Esempio n. 2
0
 public static ServiceControllerStatus GetServiceState(ServiceUnit service)
 {
     using (var sc = new ServiceController(service.ServiceName))
     {
         return(sc.Status);
     }
 }
Esempio n. 3
0
        private void StartServiceUpdateManager(ServiceUnit unit)
        {
            var updateMgrPath = unit.Folder.TrimEnd('\\') + "\\TradeSharp.UpdateManager.exe";

            if (!File.Exists(updateMgrPath))
            {
                Logger.ErrorFormat("Ошибка обновления службы {0} - файл не найден ({1})",
                                   unit.ServiceName, updateMgrPath);
                return;
            }

            Process.Start(updateMgrPath);
        }
        private void StartServiceUpdateManager(ServiceUnit unit)
        {
            var updateMgrPath = unit.Folder.TrimEnd('\\') + "\\TradeSharp.UpdateManager.exe";
            if (!File.Exists(updateMgrPath))
            {
                Logger.ErrorFormat("Ошибка обновления службы {0} - файл не найден ({1})",
                    unit.ServiceName, updateMgrPath);
                return;
            }

            Process.Start(updateMgrPath);
        }