protected void Button1_Click(object sender, DirectEventArgs e) { _UserID = txtUsername.Text; _UserPass = txtPassword.Text; if (txtUsername.Text == "" || txtPassword.Text == "") { Common._NotificationShow("请输入正确代号及密码!"); } else { string[] Astr = checkuser(_UserID); if (Astr[1] == _UserPass) { Session["USER_NAME"] = getUserName(_UserID); Session["USER_ID"] = _UserID; Session["USER_RIGHT"] = Astr[2]; JiaMiJieMi aeskey = new JiaMiJieMi(); string Key = aeskey.Base64Encrypt(aeskey.AES_Encrypt(txtKey.Text)); Registry.SetValue(@"HKEY_CURRENT_USER\Software\Datacom\product\DCS42", "License", Key); Common._ErrorMsgShow("OK OK OK"); e.Success = true; X.Redirect("login.aspx"); } else { e.ErrorMessage = "用户名或密码错误,请重新输入!"; e.Success = false; } } }
protected void Edit_Click(object sender, DirectEventArgs e) { if (txtPwd1.Text == txtPwd2.Text) { try { JiaMiJieMi aeskey = new JiaMiJieMi(); string pwdencode = aeskey.Base64Encrypt(aeskey.AES_Encrypt(txtPwd1.Text)); //string pwd = aeskey.AES_Decrypt(aeskey.Base64Decrypt(pwdencode)); string sSQL = "UPDATE access_level SET passwd='" + pwdencode + "' "; sSQL += "WHERE acclv_id=" + Userid.Text; db.Excute(sSQL); Window1.Close(); Common._NotificationShow("密码修改成功!"); } catch (Exception ex) { Common._NotificationShow("密码修改失败!"); } } else { Common._NotificationShow("请重新输入正确密码!"); txtPwd1.Focus(true, 100); } }
protected void BtnOK_Click(object sender, DirectEventArgs e) { Rockey4ND rockey = new Rockey4ND(); string hid = rockey.open(); string hidencode = aeskey.Base64Encrypt(aeskey.AES_Encrypt(Keyid.Text)); string bedencode = aeskey.Base64Encrypt(aeskey.AES_Encrypt(Bedno.Text)); rockey.WriteKey(hidencode + bedencode); rockey.close(); string sSQL = "UPDATE general_setup SET genst_desc='" + hidencode + bedencode + "' "; sSQL += "WHERE genst_ctg='License' AND genst_code='Plate'"; db.Excute(sSQL); Common._NotificationShow("Update Successed..."); }