.NET的WinForms - 怎么听系统注销事件,用户锁定,休眠启动和系统恢复?系统、事件、用户、NET

2023-09-03 07:42:39 作者:因为痛,所以叫青春

我要听我的Windows事件构成的.NET应用程序的以下系统范围内的事件:

I want to listen to events in my windows forms .NET application for the following system wide events :

注销 锁定的Windows Hibernate的入门 睡眠开始 系统已恢复

Log Off Lock Windows Hibernate Started Sleep Started System Resumed

这些是可能的吗?

感谢

推荐答案

您需要查看的WMI(Windows媒体仪器)。您需要创建事件观察家对上述事件。

You need to look WMI (Windows media instrumentation). You would need to create event watchers for the above mentioned events.

http://msdn.microsoft.com/ EN-US /库/ ms257340%28VS.80%29.aspx

相关链接:

http://stackoverflow.com/questions/984881/get-log-off-event-from-system

如何创建一个WMI事件观察对用户注销事件?

How to create a WMI Event Watcher for a user logoff event?

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0c1bded8-0cce-4260-bd28-4b4ffce0d27d

http://www.aspfree.com/c/a/VB.NET/WMI-Programming-with-Visual-BasicNET-Trapping-System-Events/1/