UserEditPassword.aspx.cs

(开头部分) 2KB

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

using MyWeb.DBUtility;
using MyWeb.WebUtility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyWeb
{
    public partial class UserEditPassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //输入框赋值
                DBHelper db = new DBHelper();
                string sql = "select * from UserInfo_Tbl where del=0 and id='" + Session["id"].ToString() + "'";
                DataSet ds = db.Query(sql);
                //将查询得到的数据赋值给文本框
                if (ds.Tables[0].Rows.Count > 0)
                {
                    //输入框的赋值
                    TextBox1.Text = ds.Tables[0].Rows[0]["account"].ToString();
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DBHelper db = new DBHelper();
            WebHelper wb = new WebHelper();
            if (TextBox2.Text == "")
            {
                wb.Alert("原密码不能为空!");
            }
            else if (TextBox3.Text == "")
            {
                wb.Alert("新密码不能为空!");
            }
            else if (TextBox4.Text == "")
            {
                wb.Alert("确认密码不能为空!");
            }
            else if (TextBox4.Text != TextBox3.Text)
            {
                wb.Alert("确认密码和新密码不一致!");
            }
            else
            {
                //判断是否存在
                string sql = "select id from UserInfo_Tbl where del=0 and account='" + TextBox1.Text + "' and id='" + Session["id"].ToString() + "' and password='" + TextBox2.Text + "'";
                DataSet ds = db.Query(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    //进行密码的更新
                    sql = "update UserInfo_Tbl set password='" + TextBox3.Text + "',account='" + TextBox1.Text + "' where id='" + Session["id"].ToString() + "' and del=0";
                    int renum = db.ExecuteSql(sql);
后面还有 18 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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