Beispiel #1
0
 private void Decript_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtOriginal.Text.Trim()))
     {
         txtDecript.Text = WhfEncryption.DESDeCrypt(txtEncript.Text.Trim());
     }
 }
Beispiel #2
0
        protected void ImageLogin_Click(object sender, ImageClickEventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtUserName.Text.Trim()))
            {
                this.lblErrorInfo.Text = "用户名不能为空!";
                return;
            }
            if (string.IsNullOrEmpty(this.txtUserPwd.Text.Trim()))
            {
                this.lblErrorInfo.Text = "用户密码不能为空!";
                return;
            }
            if (string.IsNullOrEmpty(this.txtValidCode.Text.Trim()))
            {
                this.lblErrorInfo.Text = "验证码不能为空!";
                return;
            }
            PersonController pControl = new PersonController();
            string           userName = this.txtUserName.Text.Trim();
            string           passWord = WhfEncryption.DESEnCrypt(this.txtUserPwd.Text.Trim());
            PersonEntity     pe       = pControl.GetPersonInfo(userName, passWord);

            if (pe == null)
            {
                this.lblErrorInfo.Text = "用户名或密码不正确,请重新输入!";
                return;
            }
            if (Session["ValidationCode"] != null && Session["ValidationCode"].ToString() != this.txtValidCode.Text.Trim())
            {
                this.lblErrorInfo.Text = "验证码不正确,请重新输入!";
                return;
            }
            base.PersonEntity = pe;
            Response.Redirect("Portal/index.html");
        }
Beispiel #3
0
        public SqlDBBroker()
        {
            try
            {
                string        connectionString = "";
                ConfigManager cm = (ConfigManager)Thread.GetDomain().GetData("ConfigManager");

                if (cm == null)
                {
                    throw new Exception("Palau配置管理器未在启动时加载成功!");
                }
                //读取数据库连接字符串
                connectionString = cm["ConnectionString"].ToString();

                //进行字符串的解密(默认情况下连接字符串是加密的)
                connectionString = WhfEncryption.DESDeCrypt(connectionString);
                this.conn        = new SqlConnection(connectionString);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }