怎样对asp.net中VerifyCode验证码进行验证

怎样对asp.net中VerifyCode验证码进行验证,谢谢!

VerifyCode验证码是用session存储的。我怎样在在aspx页面的page_load中获取VerifyCode验证码,并且与页面的验证码一致


开心每一天1111
浏览 970回答 2
2回答

慕森卡

protected void Page_Load(object sender, EventArgs e) {     string VerifyCode=string.Empty;     if(null!= Session["VerifyCode"])     {         Session["VerifyCode"]=null;          VerifyCode=Session["VerifyCode"].ToString().ToLower().Trim();         if(txtVerifyCode.Text.ToLower().Trim()==VerifyCode)         {             //do...         }         else         {             //do...         }     }     else     {         //do...     } }

呼如林

protected void Page_Load(object sender, EventArgs e)        {            if (!string.IsNullOrEmpty(txtVerifyCode.Text) && Session["VerifyCode"] != null)            {                if (txtVerifyCode.Text.Trim().Equals(Session["VerifyCode"].ToString()))                {                    //do…                }            }        }
打开App,查看更多内容
随时随地看视频慕课网APP