public static int loginSystem(String uid, HttpSessionState session) { if (uid == null) { throw new ArgumentNullException("用户名"); } try { int ret = DbSelect.checkUserPrivilege(uid); if (ret == FAILED) { throw new Exception("登录系统时出错:您没有权限进入本系统后台!"); } } catch (Exception ex) { throw new Exception(String.Format("登录系统时出错:{0}", ex.Message)); } session["UserID"] = uid; session["LoginTime"] = DateTime.Now.ToString(); readSessionInfo(session); return(OK); }