Detecting windows shutdown event

前端 未结 3 1413
野趣味
野趣味 2020-12-11 09:34

I have a windows Service always running once PC started, how would i detect using .NET 3.5 or WMI, when the user or some other application/process has requested a shutdown o

3条回答
  •  孤城傲影
    2020-12-11 10:13

    Win32.SessionEnded event gets fired when the system is being shut down. You should attach to this in your program.

提交回复
热议问题