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.NET CAPTCHA Chess algorithm screenshot

1 - Distortion

BotDetect ASP.NET CAPTCHA Distortion algorithm screenshot

2 - Jail

BotDetect ASP.NET CAPTCHA Jail algorithm screenshot

3 - Negative

BotDetect ASP.NET CAPTCHA Negative algorithm screenshot

4 - Snow

BotDetect ASP.NET CAPTCHA Snow algorithm screenshot

5 - Split

BotDetect ASP.NET CAPTCHA Split algorithm screenshot

6 - Wave

BotDetect ASP.NET CAPTCHA Wave algorithm screenshot

7 - WantedCircular

BotDetect ASP.NET CAPTCHA WantedCircular algorithm screenshot

8 - Stitch

BotDetect ASP.NET CAPTCHA Stitch algorithm screenshot

9 - Chess3D

BotDetect ASP.NET CAPTCHA Chess3D algorithm screenshot

10 - Circles

BotDetect ASP.NET CAPTCHA Circles algorithm screenshot

11 - Corrosion

BotDetect ASP.NET CAPTCHA Corrosion algorithm screenshot

12 - Chipped

BotDetect ASP.NET CAPTCHA Chipped algorithm screenshot

13 - Flash

BotDetect ASP.NET CAPTCHA Flash algorithm screenshot

14 - Mass

BotDetect ASP.NET CAPTCHA Mass algorithm screenshot

15 - Rough

BotDetect ASP.NET CAPTCHA Rough algorithm screenshot

16 - BlackOverlap

BotDetect ASP.NET CAPTCHA BlackOverlap algorithm screenshot

17 - Overlap

BotDetect ASP.NET CAPTCHA Overlap algorithm screenshot

18 - Overlap2

BotDetect ASP.NET CAPTCHA Overlap2 algorithm screenshot

19 - Halo

BotDetect ASP.NET CAPTCHA Halo algorithm screenshot

20 - ThickThinLines

BotDetect ASP.NET CAPTCHA ThickThinLines algorithm screenshot

21 - ThickThinLines2

BotDetect ASP.NET CAPTCHA ThickThinLines2 algorithm screenshot

22 - SunRays

BotDetect ASP.NET CAPTCHA SunRays algorithm screenshot

23 - SunRays2

BotDetect ASP.NET CAPTCHA SunRays2 algorithm screenshot

24 - Darts

BotDetect ASP.NET CAPTCHA Darts algorithm screenshot

25 - FingerPrints

BotDetect ASP.NET CAPTCHA FingerPrints algorithm screenshot

26 - CrossShadow

BotDetect ASP.NET CAPTCHA CrossShadow algorithm screenshot

27 - CrossShadow2

BotDetect ASP.NET CAPTCHA CrossShadow2 algorithm screenshot

28 - Lego

BotDetect ASP.NET CAPTCHA Lego algorithm screenshot

29 - Strippy

BotDetect ASP.NET CAPTCHA Strippy algorithm screenshot

30 - ThinWavyLetters

BotDetect ASP.NET CAPTCHA ThinWavyLetters algorithm screenshot

31 - Chalkboard

BotDetect ASP.NET CAPTCHA Chalkboard algorithm screenshot

32 - WavyColorLetters

BotDetect ASP.NET CAPTCHA WavyColorLetters algorithm screenshot

33 - AncientMosaic

BotDetect ASP.NET CAPTCHA AncientMosaic algorithm screenshot

34 - Vertigo

BotDetect ASP.NET CAPTCHA Vertigo algorithm screenshot

35 - WavyChess

BotDetect ASP.NET CAPTCHA WavyChess algorithm screenshot

36 - MeltingHeat

BotDetect ASP.NET CAPTCHA MeltingHeat algorithm screenshot

37 - SunAndWarmAir

BotDetect ASP.NET CAPTCHA SunAndWarmAir algorithm screenshot

38 - Graffiti

BotDetect ASP.NET CAPTCHA Graffiti algorithm screenshot

39 - Graffiti2

BotDetect ASP.NET CAPTCHA Graffiti2 algorithm screenshot

40 - Cut

BotDetect ASP.NET CAPTCHA Cut algorithm screenshot

41 - SpiderWeb

BotDetect ASP.NET CAPTCHA SpiderWeb algorithm screenshot

42 - Collage

BotDetect ASP.NET CAPTCHA Collage algorithm screenshot

43 - InBandages

BotDetect ASP.NET CAPTCHA InBandages algorithm screenshot

44 - Ghostly

BotDetect ASP.NET CAPTCHA Ghostly algorithm screenshot

45 - PaintMess

BotDetect ASP.NET CAPTCHA PaintMess algorithm screenshot

46 - CaughtInTheNet

BotDetect ASP.NET CAPTCHA CaughtInTheNet algorithm screenshot

47 - CaughtInTheNet2

BotDetect ASP.NET CAPTCHA CaughtInTheNet2 algorithm screenshot

48 - Bullets

BotDetect ASP.NET CAPTCHA Bullets algorithm screenshot

49 - Bullets2

BotDetect ASP.NET CAPTCHA Bullets2 algorithm screenshot
letter
about