如何来检测用户有一段时间没有动键盘鼠标了?

今天有客户抱怨我们的程序不安全,说人走了以后不能自动登陆出来。没有办法,谁能帮我想想设置一个timeout,如果用户多长时间没有动键盘鼠标,就登陆出来。
---------------------------------------------------------------

看这个问题,和你的非常相似。看Lion Shi在这个帖子中的回答。

http://www.dotnet247.com/247reference/msgs/16/82105.aspx
---------------------------------------------------------------

private void Form1_Load(object sender, System.EventArgs e)
{
Application.Idle = new EventHandler(OnIdle);
}
private void OnIdle(object sender, System.EventArgs e)
{
//login again;
}
看看这个例子

http://www.csharphelp.com/archives2/archive387.html

Published At
Categories with Web编程
Tagged with
comments powered by Disqus