简体   繁体   English

如何在Windows Service C#中获取系统启动事件?

[英]How get system start up event in windows service c#?

I am writing a windows service. 我在写Windows服务。 I want to do some functions on system start up, system lock, shutdown. 我想在系统启动,系统锁定,关机时执行一些功能。 How to get the start up,lock and shutdown events in the windows service ? 如何获取Windows服务中的启动,锁定和关闭事件?

尝试使用Microsoft.Win32.SystemEvents类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM