⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 update_password.aspx.cs

📁 oa办公系统
💻 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;

public partial class Update_PassWord : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn_change_Click(object sender, EventArgs e)
    {
        string oldpassword = FormsAuthentication.HashPasswordForStoringInConfigFile(this.toldpassword.Text.Trim().ToString(), "MD5");
        staff s = new staff();
        SqlDataReader dr = s.login(Convert.ToInt32(Session["uname"]), oldpassword);
        if (dr.Read())
        {
            string newpassword=FormsAuthentication.HashPasswordForStoringInConfigFile(this.tnewpassword.Text.Trim().ToString(),"MD5");
            s.Update_password(Convert.ToString(Session["uname"]), newpassword);
            Response.Write("<script>alert('密码修改成功!')</script>");
        }
        else
        {
            Response.Write("<script>alert('原密码输入错误!')</script>");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -