如何在系统空闲运行.NET应用程序? [英] How to run a .NET application when the system becomes idle?
问题描述
我已经创建了C#.NET程序的Windows应用程序。我想执行此应用程序,当系统空闲了一段时间。该应用程序是一个用户登录应用程序,即当系统空闲了一段时间,会出现一个登录页面,用户登录用他的用户名和密码。那么只有该用户可以继续使用该系统。
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 password. Then only the user can continue using the system.
我怎样才能使它发挥作用了呢?请帮助,因为我是新的Windows应用程序。
How can I make it work out? Please help as I am new in Windows applications.
我想运行应用程序作为Windows服务。我设法在Windows上运行服务启动的应用程序。但我怎么可以触发该应用仅在系统进入Windows中的服务,怠速运转?我还需要启动用户登录后,计时器再次检查空闲时间。请提供一些code的例子。
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.
推荐答案
这<一href="http://www.geekpedia.com/tutorial210_Retrieving-the-Operating-System-Idle-Time-Uptime-and-Last-Input-Time.html"相对=nofollow>教程的描述通过 Win32 API的。
这篇关于如何在系统空闲运行.NET应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!