Click here to Skip to main content
15,897,519 members
Articles / Web Development / ASP.NET

The Image-Based CAPTCHA: Part 2

Rate me:
Please Sign up or sign in to vote.
3.20/5 (3 votes)
20 Feb 2021CPOL3 min read 38.6K   841   30  
The article continues the topic of image-based CAPTCHAs.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Custom : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        lblError.Text = "";
    }

    protected void btnTest_Click(object sender, EventArgs e)
    {
        if (botDetector.IsValid)
            lblError.Text = "You are definitely a human.";
        else if (!botDetector.IsLocked)
            lblError.Text = "You are probably a bot.";
        else
            lblError.Text = "You are locked because of exceeding the failed attempts limit.";
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Ukraine Ukraine
I'm a software developer from Ukraine. I write about ASP.NET and other .NET related topics over at my blog

Comments and Discussions