/// <summary> /// 处理确定按钮点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btConfirm_Click(object sender, EventArgs e) { Admin admin = new Admin(); MD5CryptoServiceProvider HashMD5 = new MD5CryptoServiceProvider(); string oldPwd = ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(tbOldPwd.Text))); string newPwd1 = ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(tbNewPwd1.Text))); string newPwd2 = ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(tdNewPwd2.Text))); if (admin.ChangePassword(Session["UserName"].ToString(), oldPwd, newPwd1, newPwd2)) { //胡媛媛修改,修改跳转语句的位置,2010-01-15 Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script>alert('修改成功!');window.location='./index.aspx'</script>"); //Response.Redirect("./index.aspx"); //胡媛媛修改,修改跳转语句的位置,2010-01-15 } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script>alert('对不起,您修改密码失败,原因可能是您输入的原密码不正确或是两次输入的新密码不一致!')</script>"); } }