看这个问题,和你的非常相似。看Lion Shi在这个帖子中的回答。http://www.dotnet247.com/247reference/msgs/16/82105.aspx

解决方案 »

  1.   

    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
      

  2.   

    用System.DateTime.Now.Ticks;来判断当前应用程序已经空闲了多少时间了
      

  3.   

    谢谢TheAres(班门斧)。
    coollzh(良子)你的这种方法不行,只能判断自己的程序,其他程序的判断不出来。也还是谢谢你了。