示例#1
0
        public static void DeleteService(string serviceName)
        {
            if (!System.ServiceProcess.ServiceController.GetServices().Any(s => string.Compare(s.ServiceName, serviceName, true) == 0))
            {
                return;
            }

            ServiceControlUtils.Run(string.Format("delete {0}", serviceName));
        }
示例#2
0
 public void CreateService(string serviceName, string binPath, WinServiceServiceAccountInfo accountInfo, params string[] dependsOn)
 {
     ServiceControlUtils.CreateService(serviceName, binPath, accountInfo, dependsOn);
 }
示例#3
0
 public void DeleteService(string serviceName)
 {
     ServiceControlUtils.DeleteService(serviceName);
 }