ServiceController sc = new ServiceController(ServiceName);
if (sc != null && sc.Status == ServiceControllerStatus.Running)
{
sc.Stop();
sc.WaitForStatus(ServiceControllerStatus.Stopped);
}
Posted By
Akash Sarin
How to stop Windows service
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment