如何检测应用程序空闲时间。 [英] How to detect application idle time.

查看:87
本文介绍了如何检测应用程序空闲时间。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在应用程序中有一段时间不活动时将用户注销。这里的关键是应用程序不活动,而不是

系统。我知道您可以通过

GetLastInputInfo检索系统的不活动状态。这不是我想要的 - 我希望

应用程序不活动。


谢谢。

I want to log the user out when there has been a period of inactivity in
the application. The key here is inactivity of the application, not the
system. I know that you can retrieve the inactivity of the system via
GetLastInputInfo. That''s not what I want - I want inactivity of the
application.

Thanks.

推荐答案

您可以在应用程序中使用全局Timer,并在用户

采取任何操作时重新启动它。您必须确保用户的任何操作都将重新启动计时器。如果Timer_Tick事件发生,你知道应用程序

不活动时间。

这只是一个建议。


Ernesto Lores

Frank Rizzo <无**** @ nospam.com> escribióenel mensaje

news:uc ************** @ TK2MSFTNGP09.phx.gbl ...
You can use a global Timer in your application and restart it when the user
takes any action. You must be sure that any action of the user will restart
the Timer. If the Timer_Tick events goes, you know the application
inactivity time.
It''s only a suggestion.

Ernesto Lores
"Frank Rizzo" <no****@nospam.com> escribió en el mensaje
news:uc**************@TK2MSFTNGP09.phx.gbl...
我想登录当应用程序中存在一段时间不活动时,用户将退出。这里的关键是应用程序不活动,而不是
系统。我知道您可以通过GetLastInputInfo检索系统的不活动状态。这不是我想要的 - 我希望
应用程序不活动。

谢谢。
I want to log the user out when there has been a period of inactivity in
the application. The key here is inactivity of the application, not the
system. I know that you can retrieve the inactivity of the system via
GetLastInputInfo. That''s not what I want - I want inactivity of the
application.

Thanks.



使用静态事件Application.Idle


-

cody


免费软件工具,游戏和幽默
http://www.deutronium.de.vu || http://www.deutronium.tk

" Frank里佐" <无**** @ nospam.com> schrieb im Newsbeitrag

新闻:uc ************** @ TK2MSFTNGP09.phx.gbl ...
Use static event Application.Idle

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Frank Rizzo" <no****@nospam.com> schrieb im Newsbeitrag
news:uc**************@TK2MSFTNGP09.phx.gbl...
我想记录下来用户在应用程序中存在一段时间不活动时退出。这里的关键是应用程序不活动,而不是
系统。我知道您可以通过GetLastInputInfo检索系统的不活动状态。这不是我想要的 - 我希望
应用程序不活动。

谢谢。
I want to log the user out when there has been a period of inactivity in
the application. The key here is inactivity of the application, not the
system. I know that you can retrieve the inactivity of the system via
GetLastInputInfo. That''s not what I want - I want inactivity of the
application.

Thanks.



cody写道:
使用静态事件Application.Idle
Use static event Application.Idle




我试过,但它似乎一直在发射(即使是一个计时器事件是

已处理)且参数为空。



I tried, but it seems to fire all the time (even when a timer event is
processed) and the arguments are empty.


这篇关于如何检测应用程序空闲时间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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