protected void btnUpdate_Click(object sender, EventArgs e) { // 验证密码 string oldPassword = txtOldPass.Text.Trim(); string newPassword = txtNewPass.Text.Trim(); if (string.IsNullOrEmpty(oldPassword)) { Show("请输入原密码!"); return; } if (string.IsNullOrEmpty(newPassword)) { Show("请输入新密码!"); return; } if (oldPassword == newPassword) { Show("新密码不能与原密码一样!"); return; } Message umsg = FacadeManage.aideAccountsFacade.ModifyLogonPasswd(Fetch.GetUserCookie().UserID, TextEncrypt.EncryptPassword(oldPassword), TextEncrypt.EncryptPassword(newPassword), GameRequest.GetUserIP()); if (umsg.Success) { Fetch.DeleteUserCookie(); ShowAndRedirect("登录密码修改成功,请重新登录", "/Login.aspx"); } else { Show(umsg.Content); } }
/// <summary> /// 退出 /// </summary> private void UserLongout() { string logout = GameRequest.GetQueryString("exit"); if (logout == "true") { Fetch.DeleteUserCookie(); Response.Redirect("/Index.aspx"); } }
/// <summary> /// 退出 /// </summary> private void UserLongout() { string logout = GameRequest.GetQueryString("exit"); if (logout == "true") { Fetch.DeleteUserCookie(); Response.Redirect(string.Format("{0}/main.aspx", ServerName)); } }
protected void btnUpdate_Click(object sender, EventArgs e) { Message umsg = accountsFacade.ModifyLogonPasswd(Fetch.GetUserCookie().UserID, TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtOldPass)), TextEncrypt.EncryptPassword(txtNewPass.Text.Trim()), GameRequest.GetUserIP()); if (umsg.Success) { Fetch.DeleteUserCookie(); ShowAndRedirect("登录密码修改成功,请重新登录", "/Login.aspx"); } else { Show(umsg.Content); } }
protected void btnUpdate_Click(object sender, EventArgs e) { AccountsProtect protect = new AccountsProtect(); protect.UserID = Utility.StrToInt(ViewState["UserID"], 0); protect.LogonPass = TextEncrypt.EncryptPassword(CtrlHelper.GetText(txtNewPass)); protect.Response1 = CtrlHelper.GetText(txtResponse1); protect.Response2 = CtrlHelper.GetText(txtResponse2); protect.Response3 = CtrlHelper.GetText(txtResponse3); protect.LastLogonIP = GameRequest.GetUserIP(); Message umsg = accountsFacade.ResetLogonPasswd(protect); if (umsg.Success) { int userid = Utility.StrToInt(ViewState["UserID"], 0); if (Fetch.GetUserCookie() != null) { if (userid == Fetch.GetUserCookie().UserID) { Fetch.DeleteUserCookie(); ShowAndRedirect("重置登录密码成功,请您重新登录!", "/Login.aspx"); } else { this.form2.Visible = false; this.divRight.Visible = true; this.divRight.InnerHtml = "<div class=\"Uright\">重置登录密码成功,可用这个账号重新登录!</div>"; } } ShowAndRedirect("重置登录密码成功,请登录!", "/Login.aspx"); } else { Show(umsg.Content); txtResponse1.Text = ""; txtResponse2.Text = ""; txtResponse3.Text = ""; } }
protected void btnUpdate_Click(object sender, EventArgs e) { AccountsProtect protect = new AccountsProtect(); protect.UserID = Utility.StrToInt(ViewState["UserID"], 0); protect.LogonPass = TextEncrypt.EncryptPassword(CtrlHelper.GetTextAndFilter(txtNewPass)); protect.Response1 = CtrlHelper.GetTextAndFilter(txtResponse1); protect.Response2 = CtrlHelper.GetTextAndFilter(txtResponse2); protect.Response3 = CtrlHelper.GetTextAndFilter(txtResponse3); protect.LastLogonIP = GameRequest.GetUserIP(); Message umsg = FacadeManage.aideAccountsFacade.ResetLogonPasswd(protect); if (umsg.Success) { int userid = Utility.StrToInt(ViewState["UserID"], 0); if (Fetch.GetUserCookie() != null) { if (userid == Fetch.GetUserCookie().UserID) { Fetch.DeleteUserCookie(); ShowAndRedirect("重置登录密码成功,请您重新登录!", "/Login.aspx"); } else { RenderAlertInfo3(false, "重置登录密码成功,可用这个帐号重新登录!"); } } ShowAndRedirect("重置登录密码成功,请登录!", "/Login.aspx"); } else { Show(umsg.Content); txtResponse1.Text = ""; txtResponse2.Text = ""; txtResponse3.Text = ""; } }
protected void btnSave_Click(object sender, EventArgs e) { //获取数据 string password = CtrlHelper.GetText(txtLoginPass); string newpassword = CtrlHelper.GetText(txtNewPass); string repassword = CtrlHelper.GetText(txtRePass); //数据验证 if (string.IsNullOrEmpty(password)) { ShowInfo("抱歉,原密码不能为空"); return; } if (string.IsNullOrEmpty(newpassword)) { ShowInfo("抱歉,新密码不能为空"); return; } if (newpassword != repassword) { ShowInfo("抱歉,两次密码输入不一致"); return; } //执行修改操作 Message umsg = FacadeManage.aideAccountsFacade.ModifyLogonPasswd(userTicket.UserID, TextEncrypt.EncryptPassword(password), TextEncrypt.EncryptPassword(newpassword), GameRequest.GetUserIP()); if (umsg.Success) { Fetch.DeleteUserCookie(); Response.Redirect("/Login.aspx"); } else { ShowInfo("抱歉,修改失败,请稍后重试"); } }
protected void Page_Load(object sender, EventArgs e) { Fetch.DeleteUserCookie(); Response.Redirect("/Login.aspx"); }