BBSWeb/Manage/AlterPass.aspx.cs

(完整代码) 1KB

using System;
using WebApp;
using BBS.Model;
using BBS.BLL;
using BaseConfig;

public partial class AlterPass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.AddHeader("P3P", "CP=CAO PSA OUR");
        Response.ContentType = "text/html";
        if (!IsPostBack)
        {
            if (Session[SessionKey.USER] == null)
            {
                JS.GotoParentWindow("/login.htm");
                return;
            }
        }
    }

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (Session[SessionKey.USER] == null)
        {
            JS.GotoParentWindow("/login.htm");
            return;
        }
        if (IsValid)
        {
            string pwds = StringUtil.EncryptMD5(txtPass.Text.ToString());
            string xpwd = StringUtil.EncryptMD5(pwd.Text.ToString());
            string xpwd1 = StringUtil.EncryptMD5(pwd2.Text.ToString());
            if (xpwd == xpwd1)
            {
                X_UserInfo user = (X_UserInfo)Session[SessionKey.USER];
                if (user.PassWord != pwds)
                {
                    divOk.InnerHtml = "原密码输入不正确!";
                    divOk.Visible = true;
                    divModify.Visible = false;
                }
                else
                {
                    user.PassWord = xpwd;
                    X_UserInfoManager.UpdateUser(user);
                    divOk.InnerHtml = "修改成功!";
                    divOk.Visible = true;
                    divModify.Visible = false;
                }
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。