检测系统待机/休眠/从.NET Windows服务冬眠?检测系统、NET、Windows

由网友(好名都让狗取了)分享简介:在Windows服务,我需要检测当计算机进入睡眠,当它醒来,并运行对这些事件的一些code。这需要睡眠来完成,待机和休眠功耗模式。In a Windows Service, I need to detect when the computer goes into sleep and when it wakes up,...

在Windows服务,我需要检测当计算机进入睡眠,当它醒来,并运行对这些事件的一些code。这需要睡眠来完成,待机和休眠功耗模式。

In a Windows Service, I need to detect when the computer goes into sleep and when it wakes up, and run some code on these events. This needs to be done for sleep, standby and hibernate power modes.

我该怎么办呢?

推荐答案

重写ServiceBase.OnPowerEvent()方法。

Override the ServiceBase.OnPowerEvent() method.

阅读全文

相关推荐

最新文章