LanapBotDetect::TextStyleEnum Reference

LanapBotDetect::TextStyleEnum contains all valid values of the LanapBotDetect control's TextStyle property. It represents the distortion algorithm used for rendering of CAPTCHA images.

Members

[VB]
Public Enum CodeTypeEnum
  Chess = 0
  Distortion = 1
  Jail = 2
  Negative = 3
  Snow = 4
  Split = 5
  Wave = 6
  WantedCircular = 7
  Stitch = 8
  Chess3D = 9
  Circles = 10
  Corrosion = 11
  Chipped = 12
  Flash = 13
  Mass = 14
  Rough = 15
  BlackOverlap = 16
  Overlap = 17
  Overlap2 = 18
  Halo = 19
  ThickThinLines = 20
  ThickThinLines2 = 21
  SunRays = 22
  SunRays2 = 23
  Darts = 24
  FingerPrints = 25
  CrossShadow = 26
  CrossShadow2 = 27
  Lego = 28
  Strippy = 29
  ThinWavyLetters = 30
  Chalkboard = 31
  WavyColorLetters = 32
  AncientMosaic = 33
  Vertigo = 34
  WavyChess = 35
  MeltingHeat = 36
  SunAndWarmAir = 37
  Graffiti = 38
  Graffiti2 = 39
  Cut = 40
  SpiderWeb = 41
  Collage = 42
  InBandages = 43
  Ghostly = 44
  PaintMess = 45
  CaughtInTheNet = 46
  CaughtInTheNet2 = 47
  Bullets = 48
  Bullets2 = 49
End Enum
[C++]
typedef enum TextStyleEnum
{
  Chess = 0,
  Distortion = 1,
  Jail = 2,
  Negative = 3,
  Snow = 4,
  Split = 5,
  Wave = 6,
  WantedCircular = 7,
  Stitch = 8,
  Chess3D = 9,
  Circles = 10,
  Corrosion = 11,
  Chipped = 12,
  Flash = 13,
  Mass = 14,
  Rough = 15,
  BlackOverlap = 16,
  Overlap = 17,
  Overlap2 = 18,
  Halo = 19,
  ThickThinLines = 20,
  ThickThinLines2 = 21,
  SunRays = 22,
  SunRays2 = 23,
  Darts = 24,
  FingerPrints = 25,
  CrossShadow = 26,
  CrossShadow2 = 27,
  Lego = 28,
  Strippy = 29,
  ThinWavyLetters = 30,
  Chalkboard = 31,
  WavyColorLetters = 32,
  AncientMosaic = 33,
  Vertigo = 34,
  WavyChess = 35,
  MeltingHeat = 36,
  SunAndWarmAir = 37,
  Graffiti = 38,
  Graffiti2 = 39,
  Cut = 40,
  SpiderWeb = 41,
  Collage = 42,
  InBandages = 43,
  Ghostly = 44,
  PaintMess = 45,
  CaughtInTheNet = 46,
  CaughtInTheNet2 = 47,
  Bullets = 48,
  Bullets2 = 49
} TextStyleEnum;

Default value

If the TextStyle property is not set, 31 (Chalkboard) is used by default.

Usage

[ASP]

' Assume we are using the LanapBotDetectHandler.asp helper

' Example 1: simple assignment
<img src=
  "LanapBotDetectHandler.asp?Command=CreateImage&TextStyle=4" 
  alt="CAPTCHA image" />
	
' Example 2: randomization
<%
Function RandomFromRange(lowerLimit, upperLimit)
  Dim num
  Randomize
  num = CInt((upperlimit - lowerlimit)*Rnd() + lowerlimit) 
  RandomFromRange = num
End Function

Function RandomFromValues(values)
  Dim num
  Randomize
  num = RandomFromRange(0, UBound(values))
  RandomFromValues = values(num)
End Function

Dim algorithms(5)
algorithms(0) = 28
algorithms(1) = 36
algorithms(2) = 44
algorithms(3) = 25
algorithms(4) = 39
algorithms(5) = 48

Dim style 
style = RandomFromValues(algorithms)
%>

<img src=
  "LanapBotDetectHandler.asp?Command=
  CreateImage&TextStyle=<%=style%>" alt="CAPTCHA image" />

Direct access examples:

[VB]
Set objCaptcha = CreateObject("LanapBotDetect")
objCaptcha.TextStyle = 4
[PHP]
$objCaptcha = new COM('LanapBotDetect');
$objCaptcha->TextStyle = 4;
[Ruby]
require 'win32ole'
objCaptcha = WIN32OLE.new('LanapBotDetect')
objCaptcha.TextStyle = 4

Notes

While some CAPTCHA algorithms always uppercase the random code drawn in the image and some always lowercase it, CAPTCHA validation is always case-insensitive.

You might communicate this fact to your users by automatically uppercasing (or lowercasing) the input as they type. This can be achieved with JavaScript, and can prevent any confusion on the part of the user about how exactly they need to type the CAPTCHA code.

Screenshots

0 - Chess

BotDetect ASP CAPTCHA Chess algorithm screenshot

1 - Distortion

BotDetect ASP CAPTCHA Distortion algorithm screenshot

2 - Jail

BotDetect ASP CAPTCHA Jail algorithm screenshot

3 - Negative

BotDetect ASP CAPTCHA Negative algorithm screenshot

4 - Snow

BotDetect ASP CAPTCHA Snow algorithm screenshot

5 - Split

BotDetect ASP CAPTCHA Split algorithm screenshot

6 - Wave

BotDetect ASP CAPTCHA Wave algorithm screenshot

7 - WantedCircular

BotDetect ASP CAPTCHA WantedCircular algorithm screenshot

8 - Stitch

BotDetect ASP CAPTCHA Stitch algorithm screenshot

9 - Chess3D

BotDetect ASP CAPTCHA Chess3D algorithm screenshot

10 - Circles

BotDetect ASP CAPTCHA Circles algorithm screenshot

11 - Corrosion

BotDetect ASP CAPTCHA Corrosion algorithm screenshot

12 - Chipped

BotDetect ASP CAPTCHA Chipped algorithm screenshot

13 - Flash

BotDetect ASP CAPTCHA Flash algorithm screenshot

14 - Mass

BotDetect ASP CAPTCHA Mass algorithm screenshot

15 - Rough

BotDetect ASP CAPTCHA Rough algorithm screenshot

16 - BlackOverlap

BotDetect ASP CAPTCHA BlackOverlap algorithm screenshot

17 - Overlap

BotDetect ASP CAPTCHA Overlap algorithm screenshot

18 - Overlap2

BotDetect ASP CAPTCHA Overlap2 algorithm screenshot

19 - Halo

BotDetect ASP CAPTCHA Halo algorithm screenshot

20 - ThickThinLines

BotDetect ASP CAPTCHA ThickThinLines algorithm screenshot

21 - ThickThinLines2

BotDetect ASP CAPTCHA ThickThinLines2 algorithm screenshot

22 - SunRays

BotDetect ASP CAPTCHA SunRays algorithm screenshot

23 - SunRays2

BotDetect ASP CAPTCHA SunRays2 algorithm screenshot

24 - Darts

BotDetect ASP CAPTCHA Darts algorithm screenshot

25 - FingerPrints

BotDetect ASP CAPTCHA FingerPrints algorithm screenshot

26 - CrossShadow

BotDetect ASP CAPTCHA CrossShadow algorithm screenshot

27 - CrossShadow2

BotDetect ASP CAPTCHA CrossShadow2 algorithm screenshot

28 - Lego

BotDetect ASP CAPTCHA Lego algorithm screenshot

29 - Strippy

BotDetect ASP CAPTCHA Strippy algorithm screenshot

30 - ThinWavyLetters

BotDetect ASP CAPTCHA ThinWavyLetters algorithm screenshot

31 - Chalkboard

BotDetect ASP CAPTCHA Chalkboard algorithm screenshot

32 - WavyColorLetters

BotDetect ASP CAPTCHA WavyColorLetters algorithm screenshot

33 - AncientMosaic

BotDetect ASP CAPTCHA AncientMosaic algorithm screenshot

34 - Vertigo

BotDetect ASP CAPTCHA Vertigo algorithm screenshot

35 - WavyChess

BotDetect ASP CAPTCHA WavyChess algorithm screenshot

36 - MeltingHeat

BotDetect ASP CAPTCHA MeltingHeat algorithm screenshot

37 - SunAndWarmAir

BotDetect ASP CAPTCHA SunAndWarmAir algorithm screenshot

38 - Graffiti

BotDetect ASP CAPTCHA Graffiti algorithm screenshot

39 - Graffiti2

BotDetect ASP CAPTCHA Graffiti2 algorithm screenshot

40 - Cut

BotDetect ASP CAPTCHA Cut algorithm screenshot

41 - SpiderWeb

BotDetect ASP CAPTCHA SpiderWeb algorithm screenshot

42 - Collage

BotDetect ASP CAPTCHA Collage algorithm screenshot

43 - InBandages

BotDetect ASP CAPTCHA InBandages algorithm screenshot

44 - Ghostly

BotDetect ASP CAPTCHA Ghostly algorithm screenshot

45 - PaintMess

BotDetect ASP CAPTCHA PaintMess algorithm screenshot

46 - CaughtInTheNet

BotDetect ASP CAPTCHA CaughtInTheNet algorithm screenshot

47 - CaughtInTheNet2

BotDetect ASP CAPTCHA CaughtInTheNet2 algorithm screenshot

48 - Bullets

BotDetect ASP CAPTCHA Bullets algorithm screenshot

49 - Bullets2

BotDetect ASP CAPTCHA Bullets2 algorithm screenshot