public ActionResult UserOnlineSet() { bizUserOnlineTemp but = new bizUserOnlineTemp(); List<UserOnlineTemp> list = but.ListAll(); //foreach (var item in list) //{ // OnlineUsers.Instance.AddUser(item.UserID, item.UserName, "", 0,item.LastCheckTime); //} return View(list); }
public ActionResult Online() { bizUserOnlineTemp but = new bizUserOnlineTemp(); List<UserOnlineTemp> list = but.ListAll(); Random ran = new Random(); int RandKey = 0; foreach (var item in list) { RandKey = ran.Next(0, 2000); if(RandKey==110) OnlineUsers.Instance.RemoveUser(item.UserID); OnlineUsers.Instance.AddUser(item.UserID, item.UserName, "", 0,DateTime.Now.AddMinutes(-15)); } SZXX.Common.Untilies.OnlineUsers.Instance.ResetUser(); return View(); }