SiteAdmin/Aspx/UserPwd.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class SiteAdmin_Aspx_UserPwd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      if (Request.Cookies["roleid"] != null)
        {
            int roleid = Convert.ToInt16(Server.HtmlEncode(Request.Cookies["roleid"].Value));
            //if (roleid == 7)
            //{
            //    MessageBox.ShowAndRedirect(this.Page, "对不起!您不能修改密码。", "../Login.html");
            //}
            //else
            //{
                Label_Name.Text = HttpUtility.UrlDecode(HttpContext.Current.Request.Cookies["username"].Value);
            //}
        }
        else
        {
            MessageBox.ShowAndRedirect(this.Page, "对不起!您还没有登录系统。", "../Logout.aspx");
        }
    }
     protected void LinkButton_Pwd_Click(object sender, EventArgs e)
    {
        int userid = Convert.ToInt16(Server.HtmlEncode(Request.Cookies["userid"].Value));
        string NewPwd = this.TextBox_Confirm.Text.Trim();
        Admin myuser = new Admin();
        myuser.GetModel(userid);   
        myuser.PassWord = NewPwd;
        myuser.Update(userid);  
        this.TextBox_Pwd.Text = "";
        this.TextBox_Confirm.Text = "";
        MessageBox.succeedShow(this.Page, "密码修改成功,下次请用新密码登陆!");
      
    }
}

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

AI 解读 AI

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

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