📄 updatepass.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;
using DataAccess;
public partial class employees_UpdatePass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string cmd = "update Employees set EmpPassword='" + txtPass.Text + "' where EmpLogin='" + Session["emplogin"] + "'";
string cmd1 = "select EmpPassword from employees where EmpLogin='" + Session["emplogin"] + "'";
DataBase db = new DataBase();
string a = db.QueryValue(cmd1);
if (a == txtOPass.Text)
{
db.QueryExec(cmd);
Response.Write("<script>alert('密码修改成功!')</script>");
txtOPass.Text = "";
txtPass.Text = "";
txtPass1.Text = "";
}
else
{
Response.Write("<script>alert('旧密码错误,请重新输入!')</script>");
txtOPass.Text = "";
txtPass.Text = "";
txtPass1.Text="";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -