Example #1
0
    protected void BtnConfirm_Click(object sender, EventArgs e)
    {
        string        pwd    = "";
        string        name   = Request.Cookies["RePwdName"].Value.ToString();
        MemberInfoDAL obj    = new MemberInfoDAL();
        string        answer = obj.GetAnswerByEmail(Request.Cookies["RePwdName"].Value.ToString());

        if (answer == this.TxtAnswer.Text.ToString())
        {
            try
            {
                string mail = GetEmailByLoginName();
                //发送密码设置页
                RegisterMail mailB    = new RegisterMail();
                string       url      = mailB.GetMailResetTemplateUrl();
                string       domain   = "http://" + Request.ServerVariables["SERVER_NAME"].ToString();
                string       validurl = domain + Request.RawUrl.Replace("RetrieveStep6.aspx", "RetrieveStep3.aspx");

                mailB.SendResetMail(Server.MapPath(url), name, pwd, mail, validurl, domain);
                Response.Redirect("succeedByqu.aspx?Email=" + mail + "");
            }
            catch (Exception ex)
            {
                Response.Write("<script>alert('请重试!" + ex.Message + "'); </script>");
            }
        }
        else
        {
            this.LblMessage.Text = "回答密码保护问题错误!";
        }
    }