📄 pwd_change.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.Data.SqlClient;
using jianke;
public partial class pwd_change : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection Conn = DB.creatconnection();
Conn.Open();
string password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox2.Text, "MD5");
String str = "UPDATE Users SET Users_password='" + password + "' where Users_id='" + Session["Users_id"].ToString() + "' and Users_password='" + Session["Users_password"].ToString() + " '";
SqlCommand com = new SqlCommand(str, Conn);
com.ExecuteNonQuery();
Conn.Close();
Response.Write("<script>alert('修改成功!');</script>");
}
protected void Button2_Click(object sender, EventArgs e)
{
this.TextBox1.Text = "";
this.TextBox2.Text = "";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -