2012年9月25日

c# 防早退提醒器

摘要: <?xml version="1.0" encoding="utf-8" ?><configuration> <appSettings> <add key="WorkingStartTime" value="8:30" /> <add key="WorkingEndTime" value="17:30" /> <add key="WorkingHours" value="8&quo 阅读全文

posted @ 2012-09-25 13:54 空明流光 阅读(647) 评论(8) 推荐(0)

c# 关机、注销、重启代码

摘要: using System;using System.Text;using System.Diagnostics;using System.Runtime.InteropServices;namespace SystemManager{ /// <summary> /// 枚举类型,指定可以允许的重启操作 /// </summary> public enum RestartOptions { /// <summary> /// Shuts down all processes running in the security contex... 阅读全文

posted @ 2012-09-25 13:42 空明流光 阅读(489) 评论(0) 推荐(0)

C# 关机消息拦截的几种方法:

摘要: Microsoft.Win32.SystemEvents.SessionEnding += new Microsoft.Win32.SessionEndingEventHandler(SystemEvents_SessionEnding); protected override void WndProc(ref Message m) { const int WM_QUERYENDSESSION = 0x011; const int WM_ENDSESSION = 0x16; if (m.Msg == ... 阅读全文

posted @ 2012-09-25 11:15 空明流光 阅读(1142) 评论(0) 推荐(0)

导航