Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve the windows service uptime?

Is there is a way to get the start time of a windows service by code in C#? Is there is a way to get the number of re-starts of the windows service in last 72 hours?

like image 733
ali Avatar asked Aug 01 '11 14:08

ali


2 Answers

This for the first question.

As for the second question, I think you would need to look at the Windows events to find how many time it started, unless you can change the code to log it somewhere.

like image 104
Fredou Avatar answered Sep 29 '22 04:09

Fredou


You can try to capture it from the Event Log. As far as I know when a service starts it hooks an entry to the event log.

like image 23
cgon Avatar answered Sep 29 '22 03:09

cgon