Hello,
You can manipulate existing windows services using ServiceController
class in System.ServiceProcess namespace. You can create the service
controller with the following line of code:
System.ServiceProcess.ServiceController controller = new
System.ServiceProcess.ServiceController("ServiceNa meGoesHere");
you can check about the service state through
System.ServiceProcess.ServiceControllerStatus.
if(controller.Status ==
System.ServiceProcess.ServiceControllerStatus.Runn ing)
controller.Stop();
Please see MSDN for further details on Manipulating Windows services.
HTH. Cheers.
Maqsood Ahmed [MCP C#,SQL Server]
Kolachi Advanced Technologies
http://www.kolachi.net
*** Sent via Developersdex
http://www.developersdex.com ***