Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I need to check whether my window service is running or not on every 15 minutes, how to do it.

thanks in adv.

Gaurav Sharma
Posted

1 solution

If I am getting your question right, this is what you have to do:

Write a program which does following:
1) Gets the list of installed services:
C#
ServiceController[] services = ServiceController.GetServices();

2) Check whether your service is running or not using
C#
service.Status

3) Use a Timer control. Set Timer to 15 minutes.
Write code for step 1 and 2 in the Timer_Elapsed event.

Hope this helps.
Cheers!!!
Ankur
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900