Windows Service startup time

天大地大妈咪最大 提交于 2019-12-24 21:43:41

问题


Is there a way to programmatically retrieve start-up time/duration for all the Windows Services that have started during boot in Windows XP? That is, the time the service was initialized to getting to the "started" state.

Thank you in advance!

P.S. I'm not asking for software recommendation.


回答1:


I would start with looking at the logs in event viewer, check if that information you want is there.

If it is, then use Microsofts EventLog class to get the log you want.

For example if you're interested in the System log use -

 EventLog systemLog = new EventLog("System");

systemLog contains a collection of all entries in the System log. Should be easy from there.



来源:https://stackoverflow.com/questions/3431771/windows-service-startup-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!