📄 editpwd.aspx.cs
字号:
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;
public partial class addhomerepair : System.Web.UI.Page
{
BaseClass bc = new BaseClass();//定义一个公共类的实例
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["code"]) == "")
{
Response.Redirect("../login.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string newpwd = TextBox1.Text;
string ownerid = Session["code"].ToString();
//Response.Write(ownerid);
//Response.End();
string sqlstr = "update homeHold set password='" + newpwd + "' where code='" + ownerid + "'";
if (bc.ExecSql(sqlstr))
{
Response.Write("<script>alert('恭喜您,密码修改成功!');history.back()</script>");
}
else
{
Response.Write("<script>alert('操作失败!');history.back()</script>");
}
bc.Closeconn();
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -