Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
i want to capture inactive time for my app only.

If the user don't use my app (which is opened already) for say 5 minutes, then i want to auto log out the user and close the application.


( I am using visual studio 2005)

Thanks in advance
Posted
Updated 28-Feb-14 18:59pm
v3
Comments
BillWoodruff 1-Mar-14 0:37am    
Is this a Windows Forms Application ? Please describe the structure of the Application now: do you have the log-in process working as you wish ?
Usha Red E 1-Mar-14 0:41am    
Yes Mr.BillWooddruff, It is Windows Forms Application, I have log-in process, I need to logout the user if application is in idle for 5 minutes
BillWoodruff 1-Mar-14 6:38am    
I suggest you read this CodeProject article ... even though it's from 2004, the concepts in it are still very valid ... and read the user comments:

http://www.codeproject.com/Articles/9104/How-to-check-for-user-inactivity-with-and-without?fid=136515&df=90&mpp=50&sort=Position&spc=Relaxed&tid=2602350

And think about what type of technique you need to use based on the author's description of the pros and cons of each technique of detecting idle time.

If you make a start implementing one of those techniques, and need some help, I'll be happy to respond, and I am sure others will, too.

But, do realize, that this is an advanced C# WinForms programming problem that will probably take you into a complex (but interesting) subject area.

Do you have any experience using WinAPI calls ?
BillWoodruff 1-Mar-14 20:40pm    
I think it's possible you may benefit from the login "architecture" of Win Forms that I described in this response to a previous question on CP QA:

http://www.codeproject.com/Answers/718055/call-private-method-from-another-form

1 solution

using formsauthentication set timeout it will automatically redirect
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900