如何在验证码控制中检查条件?

编程入门 行业动态 更新时间:2024-10-12 08:25:52
本文介绍了如何在验证码控制中检查条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,先生, 我在ASP.NET中使用验证码控件.在设计页面上,我有文本框,按钮和验证码控件.现在我想要当我在文本框中输入与验证码相同的文本并单击按钮时,请检查输入的文本是否匹配. 所以我想验证一下输入的文本是否与验证码匹配. 如果不匹配,则给出错误消息. 谢谢.

Hello Sir, I am using Captcha Control in ASP.NET.On design page i have textbox ,button and captcha control. now i want that when i enter the same text as captcha in textbox and click on button than check that entered text is match or not. So i want to put the validation to check that entered text is match with captcha code. And if doesn''t match then give an error message. Thank You.

推荐答案

检查条件. check condition like that. protected void Button1_Click(object sender, EventArgs e) { CaptchaControl1.ValidateCaptcha(TextBox1.Text); if (!CaptchaControl1.UserValidated) { Label1.Text = " not sucessfull"; return; } else { Label1.Text = "Sucessfull"; } }

看看以下有关验证码工作原理的文章: CAPTCHA图像 [ ^ ] 简单的ASP.NET CAPTCHA教程 [ ^ ] 如果仍然遇到问题,请发布代码,所做的工作以及无法获取的地方.您所需要做的就是比较,然后根据比较结果升起标志. Have a look at these articles on how Captcha works: CAPTCHA Image[^] Simple ASP.NET CAPTCHA Tutorial [^] If you are still stuck, post the code, work you did and where you are unable to get it. All you need is to compare and then raise the flag based on the comparison result.

更多推荐

如何在验证码控制中检查条件?

本文发布于:2023-11-24 23:42:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:验证码   条件   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!