Example #1
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     if (!WindowsServiceUtil.IsExist(serviceName))
     {
         MessageBox.Show(serviceName + "服务不存在");
     }
     WindowsServiceUtil.ServiceStop(serviceName);
 }
Example #2
0
 private void btnInstall_Click(object sender, EventArgs e)
 {
     if (WindowsServiceUtil.IsExist(serviceName))
     {
         WindowsServiceUtil.UninstallService(serviceFilePath);
     }
     WindowsServiceUtil.InstallService(serviceFilePath);
 }
Example #3
0
 private void btnUninstall_Click(object sender, EventArgs e)
 {
     if (!WindowsServiceUtil.IsExist(serviceName))
     {
         MessageBox.Show(serviceName + "服务不存在");
     }
     WindowsServiceUtil.ServiceStop(serviceName);
     WindowsServiceUtil.UninstallService(serviceFilePath);
 }