.NET的WinForms - 怎么听系统注销事件,用户锁定,休眠启动和系统恢复? [英] .NET WinForms - How to listen to events for system LogOff, User Locked, Hibernate Started and System resumed?

查看:164
本文介绍了.NET的WinForms - 怎么听系统注销事件,用户锁定,休眠启动和系统恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要听我的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

相关链接:

<一个href="http://stackoverflow.com/questions/984881/get-log-off-event-from-system">http://stackoverflow.com/questions/984881/get-log-off-event-from-system

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

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

<一个href="http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0c1bded8-0cce-4260-bd28-4b4ffce0d27d" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0c1bded8-0cce-4260-bd28-4b4ffce0d27d

<一个href="http://www.aspfree.com/c/a/VB.NET/WMI-Programming-with-Visual-BasicNET-Trapping-System-Events/1/" rel="nofollow">http://www.aspfree.com/c/a/VB.NET/WMI-Programming-with-Visual-BasicNET-Trapping-System-Events/1/

这篇关于.NET的WinForms - 怎么听系统注销事件,用户锁定,休眠启动和系统恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆