示例#1
0
 private void btnEncript_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtOriginal.Text.Trim()))
     {
         txtEncript.Text = WhfEncryption.DESEnCrypt(txtOriginal.Text.Trim());
     }
 }
示例#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");
        }