How to run a .NET application when the system becomes idle?
I have created a .NET Windows application in C#. I want to execute this application when the system becomes idle for sometime. The application is a user login application, i.e. when system becomes idle for sometime, a login page appears where the user logins with his username and passwo开发者_运维技巧rd. Then only the user can continue using the system.
How can I make it work out? Please help as I am new in Windows applications.
I thought to run the application as a Windows service. I managed to run the application on Windows service start. But how can I trigger the app to run only when system goes to idle in Windows service? I also need to start the timer after the user logins to check idle time again. Please provide some code examples.
The system already comes with such functionality. On the screen saver configuration page you simply check the box titled "On resume, display logon screen". It can be configured with group policy.
There's absolutely no point re-implementing this.
How about:
- Start your form hidden
- Get the system idle time
- Show your window.
精彩评论