//解密 protected void Button2_Click(object sender, EventArgs e) { //string sqltext = "SELECT ST_PASSWORD FROM TBDS_STAFFINFOR WHERE ST_CODE ='" + Session["ST_CODE"].ToString() + "'"; //SqlDataReader dr = DBCallCommon.GetDRUsingSqlText(sqltext); Encrypt_Decrypt ed = new Encrypt_Decrypt(); if (TextBox1.Text.Trim() != "") { TextBox2.Text = ed.MD5Decrypt(TextBox1.Text, "!@#$%^&*"); } }
//密码还原 protected void btnCom_Click(object sender, EventArgs e) { string sqltext = "SELECT ST_PASSWORD FROM TBDS_STAFFINFO WHERE ST_CODE ='" + Session["UserID"].ToString() + "'"; SqlDataReader dr = DBCallCommon.GetDRUsingSqlText(sqltext); Encrypt_Decrypt ed = new Encrypt_Decrypt(); if (dr.Read()) { txtPassword.Text = ed.MD5Decrypt(dr["ST_PASSWORD"].ToString(), "!@#$%^&*"); } dr.Close(); }