如何在Windows应用程序中使用会话超时 [英] How to use session time out in windows application

查看:223
本文介绍了如何在Windows应用程序中使用会话超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在我的项目中,我使用的是Windows应用程序..



但这里有如何使用会话时间在Windows应用程序中??????





请给出任何建议........

Hi
In my project i am using windows application..

but here how to use session time out in windows application??????


please give any suggestion........

推荐答案

最简单的解决方案是使用Timer并将Duration属性设置为超时时的毫秒数。无论何时遇到活动,您都可以通过调用Stop然后立即调用Start来重置计时器。在Timer的Tick事件中放置你想要的任何代码(假设这是一个 System.Windows.Forms.Timer ),你将全部设置好。



(来源: Stack Overflow
Your simplest solution would be to use a Timer and set the Duration property to the number of milliseconds you''d like in your timeout. Whenever you encounter activity, you can just reset the timer by calling Stop then immediately calling Start. Place whatever code you''d like in the Timer''s Tick event (assuming this is a System.Windows.Forms.Timer) and you''ll be all set.

(Source : Stack Overflow)


这篇关于如何在Windows应用程序中使用会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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