如何使用C#检查系统是否空闲? [英] How to check the system idle or not using c#?

查看:165
本文介绍了如何使用C#检查系统是否空闲?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建了一个程序,必须检查计算机是否闲置.如果我5秒钟内未在系统中做任何事情,现在应该显示一条消息您的系统处于闲置状态".例如,我打开了ms单词并输入了一些内容,然后我停了五秒钟,然后应该出现您的系统处于空闲状态"的消息.我该怎么办?我请求您的建议.

谢谢您.

Hi,

I have created a program in that i have to check that my computer is idle or not.if i didn''t do any thing in my system for 5 seconds,now a message should be displayed that "your system is idle".for example i have opend ms word and typed some thing and i stop for five seconds,then the message "your system is idle" should come. how can i do this?I request your suggestion.

Thank you

推荐答案

好几个关于这个主题的文章在这里:

应用程序空闲 [使用C#获取用户空闲时间 [ ^ ]

将它们签出,然后重新发布.

欢呼声
Well there are several articles on this theme here:

Application Idle[^]
Getting the user idle time with C#[^]

Check them out and re-post if any.

Cheers


此处措辞错误.我从您那里得到的问题是,您对系统是否处于空闲状态不感兴趣,而是对处理它的人感兴趣.一个系统很可能会承受一些轻微的压力,并且位于系统前面的人会像您所想象的那样处于非活动状态.因此,检查系统是否空闲对您的工作无济于事.如果确实确实需要检查操作员空闲",则可以通过添加全局鼠标和键盘挂钩来测量活动"来进行检查. 注意事项:除了监控员工的法律问题外,该系统还可以通过随意移动鼠标并敲击键盘来轻松击败.


Mario与CP上的文章有很好的链接:获取用户空闲时间与C# [ ^ ]
[/编辑]

问候,

曼弗雷德(Manfred)
Wrong wording here. What I garnered from you question you are not interested if the system is idle, but rather the person handling it. A system can well be under some mild stress and the person in front of it as inactive as you can imagine. So checking if the system is idle will not really help your here. If it is indeed the case that you want to check for "operator idleness" you could do so by adding a global mouse and keyboard hook to measure "activity". Caveat: Aside from legal issues arising from the monitoring of ones employees this system can just as easily defeated by randomly moving your mouse and tapping on the keyboard.


Mario has a great link to an article on CP: Getting the user idle time with C#[^]
[/Edit]

Regards,

Manfred


这篇关于如何使用C#检查系统是否空闲?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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