EditPassword.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 SelectCourseSystem
{
public partial class EditPassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//首次加载
if (!IsPostBack)
{
//输入框赋值
TextBox1.Text = Session["name"].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,name from UserInfo_Tbl where del=0 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 + "' where id='" + Session["id"].ToString() + "' and del=0";
int renum = db.ExecuteSql(sql);
if (renum == 1)
{
//成功
wb.Alert("密码修改成功!");
}
else
{
wb.Alert("修改密码失败,请刷新重试!");
}
后面还有 9 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。