C# 监控Windows睡眠与恢复

SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

private void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
        {
            switch (e.Mode)
            {
                case PowerModes.Suspend:
                    break;
                case PowerModes.Resume:
                    break;
            }
        }

 

posted @ 2017-10-30 17:18  akiing  阅读(1413)  评论(0编辑  收藏  举报