Arun
Arun

Reputation: 738

How to close the session in asp.net if computer idle for 5 mins

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.

Upvotes: 0

Views: 286

Answers (1)

Steve B
Steve B

Reputation: 37660

ASP.Net is a bad choice for this requirement. ASP.Net runs on the server, while you 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.

You should create a classic desktop application, or search for an option in the GPOs, there's maybe something.

The simple solution I can suggest is :

  1. Create a small script file that logoff the user (search for the logoff command line)
  2. Create a scheduled task that :
    1. triggers when a specified amount of idle time has been reached
    2. launch the script file you wrote
  3. Deploy the scheduled task to the users using whatever method you want

If you choose this approach, I recommand you to move to http://superuser.com or http://serverfault.com, which are correct place for such cases

Upvotes: 1

Related Questions