如果计算机闲置5分钟,如何在asp.net中关闭会话 [英] How to close the session in asp.net if the computer is idle for 5 mins

查看:91
本文介绍了如果计算机闲置5分钟,如何在asp.net中关闭会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用ASP.NET开发Web应用程序,如果计算机闲置5分钟,我想关闭当前的用户会话。 Idle不仅仅适用于Web应用程序,它的完整系统意味着如果没有键盘从键盘接收5分钟。



我通过Google了解了VC ++中的Idle Tracker但我不知道如何在我的Web应用程序中使用该DLL。链接此处



请指导我如何实现这一目标。我希望通过asp.net获取总计算机活动时间和空闲时间,以获得我的员工生产力报告。



问候

Arun。

8056171741.

Hi All,

I m developing web application using ASP.NET and I want to close the current user session if the computer is idle for 5 minutes. Idle not means for web application only, Its full system that means if no keystroke received from keyboard for 5 mins.

I got some info thru Google about Idle Tracker in VC++ but I dont know how to use that DLL in my web application. Link here.

Please guide me how to achieve this. I want to get the total computer active time and idle time thru asp.net for my employees productivity report.

Regards
Arun.
8056171741.

推荐答案

首先,您需要了解Windows应用程序和Web应用程序之间的差异。 Tha VC ++库适用于Windows应用程序,不能由Web应用程序使用。

要实现您描述的内容,您必须使用javascript来跟踪鼠标移动,如果鼠标在特定时间内没有移动,则将用户重定向到注销脚本。



使用javascript跟踪鼠标移动很简单,并结合javascript计时器,您可以实现您所要求的功能。每次鼠标移动时,都会重置计时器。如果您的计时器超过5000毫秒,那么您将用户重定向到注销脚本。
First of all you need to understand the differences between a windows application and a web application. Tha VC++ library is for windows applications and can''t be used by a web application.
To achive what you describe, you have to use javascript to track mouse move, and redirect the user to a logout script if the mouse doesn''t move for a specific amount of time.

To track mouse movement using javascript is easy, and combined with a javascript timer, you can achive the functionality you are asking for. Everytime the mouse moves, you reset your timer. If your timer exceeds 5000 ms, then you redirect the user to a logout script.


谢谢冲积,



ASP。对于这个要求,净是一个糟糕的选择。 ASP.Net在服务器上运行,但我想跟踪一些客户端事件。出于安全原因,如果不使用ActiveX或浏览器插件,网页就不具备此类权限,但是编写起来很复杂,部署起来很复杂,而且安全漏洞的打开窗口很大。



我理解Windows应用程序和Web应用程序之间的区别。 VC ++库适用于Windows应用程序,不能由Web应用程序使用。



有一种方法可以实现这一点,我必须使用javascript来跟踪鼠标移动,并在鼠标移动时将用户重定向到注销脚本在特定的时间内。



但我绝对无法在客户端计算机上监控网站外的击键或鼠标移动。那是件好事!试想一下,这将如何落入错误的人手中。因此,如果它也可以实现,则不应该鼓励它。



所以我关闭了这个问题并在WPF中开始了相同的任务。
Thank you Alluvial,

ASP.Net is a bad choice for this requirement. ASP.Net runs on the server, but I want to track some client side events. For security reasons, a web page can''t have such privileges without the use of ActiveX or browser plugin, but it''s complex to write, complex to deploy and a big opened window to security breaches.

I understood the differences between a windows application and a web application. The VC++ library is for windows applications and can''t be used by a web application.

There is a way to achieve this, I have to use javascript to track mouse move, and redirect the user to a logout script if the mouse doesn''t move for a specific amount of time.

But There is absolutely no way I can monitor keystrokes or mouse movement outside the website on clients computer. And that''s a good thing! Just imagine how that would be in the hands of the wrong people. So if its achievable also, it should not be encouraged.

So I m closing the question and have started the same task in WPF.


这篇关于如果计算机闲置5分钟,如何在asp.net中关闭会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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