/// <summary> /// 根据用户传入的PageID.检查当前用户是否对指定的页面具有访问权限。 /// </summary> /// <param name="PID"></param> public static void Check_User() { Hashtable hOnline = (Hashtable)System.Web.HttpContext.Current.Application["Online"]; if (hOnline != null) { IDictionaryEnumerator idE = hOnline.GetEnumerator(); while (idE.MoveNext()) { if (idE.Key != null && idE.Key.ToString().Equals(System.Web.HttpContext.Current.Session.SessionID)) { //already login if (idE.Value != null && "XXXXXX".Equals(idE.Value.ToString())) { hOnline.Remove(System.Web.HttpContext.Current.Session.SessionID); System.Web.HttpContext.Current.Application.Lock(); System.Web.HttpContext.Current.Application["Online"] = hOnline; System.Web.HttpContext.Current.Application.UnLock(); //Maticsoft.Common.MessageBox.ShowAndRedirect( "你的帐号已在别处登陆,你被强迫下线!!!", "../Admin/login.aspx"); JScript.AlertandRedirectParent("你的帐号已在别处登陆,你被强迫下线!!!", "../Admin/login.aspx"); } break; } } } string UserID = string.Empty; if (System.Web.HttpContext.Current.Session["UserID"] == null) { JScript.AlertandRedirectParent("服务已经超时,请重新登录!!!", "../Admin/login.aspx"); } //当用户ID不为空时,保存他登录的日志 else { UserID = System.Web.HttpContext.Current.Session["UserID"].ToString(); string Ljbh = System.Web.HttpContext.Current.Session["Ljbh"].ToString(); string currentFilePath = System.Web.HttpContext.Current.Request.FilePath; string CurrentPageName = currentFilePath.Substring(currentFilePath.LastIndexOf("/") + 1); ArrayList list = new ArrayList(); //增加操作日志 string strSql1 = "INSERT INTO ShDaily([UserID],[OperPage],[Ljbh])VALUES('" + UserID + "','" + CurrentPageName + "','" + Ljbh + "')"; list.Add(strSql1); DataBase.ExecuteSqlGroup(list); } }