How to know when was Windows started or shutdown?

前端 未结 7 689
粉色の甜心
粉色の甜心 2020-12-10 05:12

I need to develop a program in C# find out when was Windows started or shutdown.

Is there a log file that I can read to know Windows start and shutdown times? Or do

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 05:27

    You can use the classes in System.Diagnostics.Eventing.Reader to access the system Event Logs.

提交回复
热议问题