Download Image-Based Bot Detector
Requires .NET Framework 2.0
Overview, helpIn order to use it you have to set TemplateImageFolder property to relative virtual path of the template images folder - for example, "~/templates" and to add registration of HttpHandler in web.config.
<httpHandlers>There are 3 types of predefined distortion (Stretched, Random, Volute) and user-defined (Custom) distortion. In order to use predefined distortion it needs to set DistortionType property. User-defined distortion can be used in derived classes with overriden DrawCustom method.
<add verb="GET" path="ImageBasedBotDetector.ashx"
If you want to use template images that are placed elsewhere then a subfolder of your web application - for example, from database - you have to override GetTemplateImage method.
To check whether user passed the test IsValid property is used. Also user can be locked after a predefined number of unsuccessful attempts to pass the test (FailedAttemptsBeforeLocking property, default value is 5).
|Gets or sets template image folder.|
|Gets or sets the number of unsuccessful attempts before locking.|
|Gets result of test passing.|
|Gets or sets value indicating where user is locked.|
|Gets or sets distortion type. Available types: |
|Occurs when detector has been locked because of exceeding the failed attempts limit.|
public event EventHandler Locked
|Protected virtual methods|
|Gets template image.|
protected virtual System.Drawing.Image GetTemplateImage()
See example of usage.
|Distorts specified rectangle of image in a user defined way. Have to be used coupled with DistortionType=Custom|
protected virtual void DrawCustom(System.Drawing.Bitmap bitmap, System.Drawing.Image img, Rectangle distortedRectangle)
bitmap - the output image,
img - the template (input) image,
distortedRectangle - area on the image to be distorted.