/// <summary> /// 校验登录密码 /// </summary> /// <param name="strLoginName"></param> /// <param name="strPassword"></param> /// <returns></returns> public static bool VerifyLogin(string strLoginName, string strPassword) { _IsVerifySuccess = false; bool bolIsLogin = false; DataTable dtUser = GetUserInfo(strLoginName); if (dtUser.Rows.Count == 0) { throw new Exception("该用户名称不存在!"); } else { string strUserPassword = dtUser.Rows[0]["UserPassword"].ToString().TrimEnd(); int iUserID = Convert.ToInt32(dtUser.Rows[0]["UserID"]); int iUserType = Convert.ToInt32(dtUser.Rows[0]["UserType"]); //string strImputPassword = LBEncrypt.DESEncrypt(strPassword, "linrubin"); if (LBEncrypt.DESEncrypt(strPassword, "linrubin") == strUserPassword) { bolIsLogin = true; _UserID = iUserID; _IsVerifySuccess = true; _LoginName = strLoginName; _LoginTime = DateTime.Now; _IsVerifySuccess = true; _UserType = iUserType; } else { throw new Exception("密码不正确,请重新输入!"); } } return(bolIsLogin); }
//校验软件权限 public static void ReadRegister(out bool IsRegister, out int ProductType, out DateTime DeadLine, out Dictionary <string, object> dictModel) { dictModel = new Dictionary <string, object>(); string RegisterInfoJson; IFaxBusiness.IMyFaxBusiness webservice = GetWebService(); webservice.ReadRegister(out IsRegister, out ProductType, out RegisterInfoJson, out DeadLine); if (RegisterInfoJson != "") { dictModel = LBEncrypt.GetRegisterModelInfo(RegisterInfoJson); } }
/// <summary> /// 校验密码是否正确 /// </summary> /// <param name="strLoginName"></param> /// <param name="strPassword"></param> /// <returns></returns> public static bool VerifyPassword(int iUserID, string strPassword) { bool bolIsVerify = false; DataTable dtUser = GetUserInfo(iUserID); if (dtUser.Rows.Count == 0) { throw new Exception("该用户名称不存在!"); } string strUserPassword = dtUser.Rows[0]["UserPassword"].ToString().TrimEnd(); if (LBEncrypt.DESEncrypt(strPassword, "linrubin") == strUserPassword) { bolIsVerify = true; } return(bolIsVerify); }
/// <summary> /// 加密密码 /// </summary> /// <param name="strPassword"></param> /// <returns></returns> public static string EncryptPassword(string strPassword) { return(LBEncrypt.DESEncrypt(strPassword, "linrubin")); }