62,243
社区成员




/// <summary>
/// 修改密码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnUpdatePwd_Click(object sender, EventArgs e)
{
string id = txt_selectID.Value;
CheckFunction cs = new CheckFunction();
string strYuanPwd = cs.EncryptPassword(yuanPwd.Value, "md5");
string strNewPwd = newPwd.Value;
string strQuePwd = quePwd.Value;
DataSet ds = new DataSet();
ds =CommBLL.Select("","kim_admin","sid = "+id);
if (ds.Tables[0].Rows.Count > 0)
{
if (strYuanPwd == ds.Tables[0].Rows[0]["userpwd"].ToString())
{
if (strQuePwd == strNewPwd)
{
if (CommBLL.Update(id,"kim_admin",string.Format("userpwd = '{0}'", cs.EncryptPassword(newPwd.Value.Trim(), "md5")), string.Format("sid = {0}",id)))
{
Response.Write("<script>alert('修改密码成功!')</script>");
}
}
else
{
Response.Write("<script>alert('二次密码输入有误!')</script>");
}
}
else
{
Response.Write("<script>alert('原始密码输入有误!')</script>");
}
}
}