在服务器端验证验证码 [英] Validating recaptcha on server side

查看:406
本文介绍了在服务器端验证验证码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用在我们的项目之一,谷歌验证码。我加入aspx页面的ReCaptcha控制。现在我想在验证验证码即无论正确与否输入的值。我怎样才能做到在一个按钮单击事件?我使用C#。


解决方案

 如果要是CAPTCHA文本是正确的(Page.IsValid)//将是真实的,否则这将是错误的
{
 // ***您code ****}

编辑:
呼叫
Page.Validate()检查条件之前

I am using Google recaptcha in one of our projects. I added the recaptcha control in aspx page. Now i want to validate the value entered in recaptcha that is whether it is correct or not. How can i done it in a button click event? I am using c#.

解决方案

if(Page.IsValid) //Will be true if captcha text is correct otherwise it will be false
{
 //***your code****

}

Edit: call Page.Validate() before checking condition

这篇关于在服务器端验证验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆