"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Thursday, April 29, 2010

Programmatically determine if a Windows Service is running and stop it

The ServiceController class makes it easy to retrieve information about a windows service and manipulate it. Here’s some code. Before running this example, make sure you have added a reference to System.ServiceProcess


Make sure you have permission to stop the service or else you will get an exception.

Have a nice day... 'N happy Coding :)

No comments: