mem/pass.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using System.Data.SqlClient;


public partial class mem_Default  : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if(!IsPostBack)
        {
            
            
        }
    }

        /// <summary>
    /// 修改密码
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnPass_Click(object sender, EventArgs e)
    {
        if (txt_pass2.Text == txt_pass3.Text)
        {
            SqlDataReader sdr = DbHelperSQL.ExecuteReader("select * from student where  number='" + Session["lname"].ToString() + "' and pass='" + txt_pass1.Text + "'");
            if (sdr.Read())
            {
                DbHelperSQL.ExecuteSql("update student set pass='" + txt_pass2.Text + "' where number='" + Session["lname"].ToString() + "'");
                MessageBox.Show(this, "修改成功!");

            }
            else
            {
                MessageBox.Show(this, "原密码不正确!");
            }
            sdr.Close();
        }
        else
        {
            MessageBox.Show(this, "两次密码输入不一致!");
        }
    }


}

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

AI 解读 AI

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

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