studChangePwd.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 changePwd : System.Web.UI.Page
{
SqlConnection conn;
SqlCommand cmd;
//SqlDataAdapter sda;
SqlDataReader dr;
//DataSet ds;
protected void Page_Load(object sender, EventArgs e)
{
// 下载于www.51aspx.com
}
protected void Button1_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["studPwd"].ToString() == oldPwd)
{
if (rightPwd == newPwd)
{
string studName = Session["studName"].ToString();
string commandText = "update student set studPwd='" + newPwd + "'where studName='" + studName + "'";
cmd = new SqlCommand(commandText, conn);
if (Convert.ToInt32(cmd.ExecuteNonQuery()) > 0)
{
Response.Write("<script>alert('恭喜你,密码修改成功!');location.href='studGoodhome.aspx'</script>");
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 = "";
}
后面还有 17 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。