在vb .net中特定时间后阻止应用程序 [英] Blocking an Application after specific duration in vb .net

查看:166
本文介绍了在vb .net中特定时间后阻止应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

如果要在特定时间段内不使用我要阻止其运行的应用程序.为此,我想设置一个特定的值,之后我的应用程序将显示登录屏幕,用户将重新登录该应用程序.

我知道 IMessagefilter 可以用于相同但完全不知道如何将其放入代码中的方法.

如果有人完成了这种功能,请同样指导我.

Vinay Sarmalkar

Dear All,

I want to block my running application if not used for specific period. For this I want to set particular value after which my application will show login screen and user will re-login in the application.

I come to know that IMessagefilter can be use for the same but totally unware how to put this into the code.

If anybody done this kind of functionality please guide me for the same.

Vinay Sarmalkar

推荐答案

也许这是 Codeproject文章 [ ^ ]很有帮助.
Maybe this Codeproject-article[^] on IMessagefilter is of help.


您可以使用计时器 [^ ]在不活动后触发事件(使用Interval属性设置).通过IMessageFilter.PreFilterMessage方法,您可以先调用Timer.Stop()然后调用Timer.Start(),这将有效地重置计时器.
You can use a Timer[^] to fire an event after inactivity (set with the Interval property). From your IMessageFilter.PreFilterMessage method, you can call Timer.Stop() then Timer.Start(), which will effectively reset the timer.


这篇关于在vb .net中特定时间后阻止应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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