homeadminChangepwd.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class adminChangePwd : System.Web.UI.Page
{
    SqlConnection conn;
    SqlCommand cmd;
    SqlDataReader dr;

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void enter_Click(object sender, EventArgs e)
    {
        string oldPwd = this.oldPwd.Text;
        string newPwd = this.newPwd.Text;
        string rightPwd = this.rightPwd.Text;
        conn = sqldata.createCon();
        conn.Open();
        if (Session["homeAdminPwd"].ToString() == oldPwd)
        {
            if (rightPwd == newPwd)
            {
                string adminName = Session["homeAdminName"].ToString();
                string commandText = "update homeAdmin set homeAdminPwd='" + newPwd + "'where homeAdminName='" + adminName + "'";
                cmd = new SqlCommand(commandText, conn);
                if (Convert.ToInt32(cmd.ExecuteNonQuery()) > 0)
                {
                    Response.Write("<script>alert('恭喜你,密码修改成功!');location.href='homeadminGoodhome.aspx'</script>");
                    this.oldPwd.Text = "";
                    this.newPwd.Text = "";
                    this.rightPwd.Text = "";
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "info", "alert('数据库操作失败,请稍后再试!');", true);
                    this.oldPwd.Text = "";
                    this.newPwd.Text = "";
                    this.rightPwd.Text = "";
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "info", "alert('确认密码不正确!');", true);
                this.oldPwd.Text = "";
                this.newPwd.Text = "";
                this.rightPwd.Text = "";
            }

后面还有 18 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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