Пример #1
0
        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 = "";
            }
        }