📄 modifypass.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 System.IO;
//using UserInfoLib;
public partial class ModifyPass : System.Web.UI.Page
{
public string iname ;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if ((Session["User"] != null) && (Session["Pwd"] != null))
{
BLL.Class1 getuserlaber = new BLL.Class1();
this.LabelName.Text = Session["User"].ToString();
this.TextBoxPassword.Text = Session["Pwd"].ToString();
this.TextBox1.Text = getuserlaber.getuserlaber(this.LabelName.Text, this.TextBoxPassword.Text);
}
else
{
this.Response.Write("<script>alert('您还没有登陆!');</script>");
this.Response.Redirect("index.aspx");
}
}
}
protected void ButtonExit_Click(object sender, EventArgs e)
{
this.Response.Write("<script>window.setTimeout('window.close()',0)</script>");
}
protected void ButtonModify_Click(object sender, EventArgs e)
{
BLL.Class1 updateInfo=new BLL.Class1();
string username = this.LabelName.Text;
string pwd = this.TextBoxPassword.Text;
string userlaber = this.TextBox1.Text;
if (FileUpload1.FileName != null || FileUpload1.FileName != "")
{
this.FileUpload1.PostedFile.SaveAs(this.Server.MapPath("UPimage") + "\\" + Path.GetFileName(FileUpload1.PostedFile.FileName));
iname = "~\\UPimage\\" + this.FileUpload1.FileName;
}
if (updateInfo.updateuser(username, pwd, userlaber, this.iname))
{
this.Response.Write("<script>alert('修改成功');</script>");
this.TextBoxPassword.Text = updateInfo.showpwd(this.LabelName.Text);
}
else
{
this.Response.Write("<script>alert('修改失败');</script>");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -