- XmlDocument xDoc = new XmlDocument();
- long userTime = 0;
- try
- {
- xDoc.Load("./xml/system.xml");
- XmlNode hw = xDoc.FirstChild.SelectSingleNode("用户掉线时间");
- userTime = Convert.ToUInt16(hw.SelectSingleNode("uTime").InnerText);
- }
- catch
- {
- userTime = 300;
- }
- long time = GetLastInputTime() / 1000;
- this.toolStripStatusLabel6.Text = string.Format("用户无操作{0}秒", time);
- if (time >= userTime)
- {
- if (UserManager.CurrentUser.UserLevel > NewScan.UserLevel.生产线)
- {
- UserManager.UserLogout();
- timerUserScan.Stop();
- Thread.Sleep(50);
- hooktime.Restart();
- }
- }
复制代码
|