Exemplo n.º 1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        MemberBL memBL      = new MemberBL();
        string   passwrod   = FormsAuthentication.HashPasswordForStoringInConfigFile(AntiXss.HtmlEncode(PW.Text), "MD5");
        string   new_pw     = FormsAuthentication.HashPasswordForStoringInConfigFile(AntiXss.HtmlEncode(newPW.Text), "MD5");
        string   confirm_pw = FormsAuthentication.HashPasswordForStoringInConfigFile(AntiXss.HtmlEncode(confirm.Text), "MD5");

        if (memBL.modify_pw(Session["username"].ToString(), passwrod, new_pw) > 0)
        {
            Response.Redirect("~/Member/mem_modifyPwOK.aspx");
        }
        else
        {
            Response.Write("<script>alert('修改密碼失敗!');</script>");
        }
    }