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.
- TextStyleEnum Members
- TextStyleEnum Default
- TextStyleEnum Usage
- TextStyleEnum Notes
- TextStyleEnum Screenshots
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
1 - Distortion
2 - Jail
3 - Negative
4 - Snow
5 - Split
6 - Wave
7 - WantedCircular
8 - Stitch
9 - Chess3D
10 - Circles
11 - Corrosion
12 - Chipped
13 - Flash
14 - Mass
15 - Rough
16 - BlackOverlap
17 - Overlap
18 - Overlap2
19 - Halo
20 - ThickThinLines
21 - ThickThinLines2
22 - SunRays
23 - SunRays2
24 - Darts
25 - FingerPrints
26 - CrossShadow
27 - CrossShadow2
28 - Lego
29 - Strippy
30 - ThinWavyLetters
31 - Chalkboard
32 - WavyColorLetters
33 - AncientMosaic
34 - Vertigo
35 - WavyChess
36 - MeltingHeat
37 - SunAndWarmAir
38 - Graffiti
39 - Graffiti2
40 - Cut
41 - SpiderWeb
42 - Collage
43 - InBandages
44 - Ghostly
45 - PaintMess
46 - CaughtInTheNet
47 - CaughtInTheNet2
48 - Bullets
49 - Bullets2


