ASP Classic CAPTCHA Troubleshooting VBScript Code Sample
The ASP Classic Captcha troubleshooting sample project shows how to use the BotDetect Troubleshooting helper to debug BotDetect CAPTCHA issues.
This helper can help diagnosing and resolving any BotDetect issues you might encounter on your servers.
First Time Here?
Check the BotDetect Developer Crash Course for key integration steps.
BotDetectDebug.asp file to your project, and the <%=SampleCaptcha.Troubleshooting %> statement will display Captcha instance and persistence values.
Download the BotDetect Classic ASP CAPTCHA Component and run this sample
Installed Location
By default, the Classic ASP basic Captcha sample project is installed at:
C:\Program Files\Lanapsoft\BotDetect 3 CAPTCHA Component\Asp\WebApp\CaptchaTroubleshootingSample
You can also run it from the BotDetect Start Menu:
Programs > Lanapsoft > BotDetect 3 CAPTCHA Component > ASP > Web Applications > Run
Default.asp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www. w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>BotDetect ASP CAPTCHA Troubleshooting Sample</title> <link type="text/css" rel="Stylesheet" href="StyleSheet.css" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!-- #include file ="BotDetect.asp" --> </head> <body> <form method="post" action="" id="form1"> <h1>BotDetect ASP CAPTCHA Troubleshooting Sample</h1> <fieldset> <legend>ASP CAPTCHA validation</legend> <label for="CaptchaCode">Retype the characters from the picture:</label> <% ' Adding BotDetect CAPTCHA to the page Dim SampleCaptcha : Set SampleCaptcha = (New Captcha)("SampleCaptcha") SampleCaptcha.Locale = "en-CA" SampleCaptcha.CodeLength = 4 SampleCaptcha.CodeStyleName = "Numeric" SampleCaptcha.ImageStyleName = "Fingerprints" SampleCaptcha.ImageWidth = 200 SampleCaptcha.ImageHeight = 80 SampleCaptcha.ImageFormatName = "gif" SampleCaptcha.SoundStyleName = "Pulse" SampleCaptcha.SoundFormat = 1 SampleCaptcha.SoundFormatName = "WavPcm8bit8kHzMono" SampleCaptcha.UserInputID = "CaptchaCode" %> <%=SampleCaptcha.Html %> <div class="validationDiv"> <input name="CaptchaCode" type="text" id="CaptchaCode" /> <input type="submit" name="ValidateCaptchaButton" value="Validate" id="ValidateCaptchaButton" /> <% ' CAPTCHA user input validation (only if the form was sumbitted) If Request.ServerVariables("REQUEST_METHOD") = "POST" Then Dim isHuman : isHuman = SampleCaptcha.Validate() If Not isHuman Then ' CAPTCHA validation failed, show error message Response.Write "<span class=""incorrect"">Incorrect code</span>" Else ' CAPTCHA validation passed, perform protected action Response.Write "<span class=""correct"">Correct code </span>" End If End If %> <%=SampleCaptcha.Troubleshooting %> </div> </fieldset> </form> </body> </html>
BotDetect\CaptchaConfig.asp
<% ' Captcha code configuration ' --------------------------------------------------------------------- LBD_Configuration_CodeLength = 5 LBD_Configuration_CodeStyle = 0 LBD_Configuration_CodeTimeout = 1200 LBD_Configuration_Locale = "en-US" LBD_Configuration_CustomCharset = "" LBD_Configuration_BannedSequences = "" ' Captcha image configuration ' --------------------------------------------------------------------- LBD_Configuration_ImageStyle = LBD_RandomFromRange(0, 59) LBD_Configuration_ImageWidth = 200 LBD_Configuration_ImageHeight = 80 LBD_Configuration_ImageFormat = 0 LBD_Configuration_CustomDarkColor = "" LBD_Configuration_CustomLightColor = "" LBD_Configuration_HelpLinkEnabled = True LBD_Configuration_HelpLinkUrl = "http://captcha.biz/captcha.html" LBD_Configuration_ImageTooltip = "CAPTCHA" ' Captcha sound configuration ' --------------------------------------------------------------------- LBD_Configuration_SoundEnabled = True LBD_Configuration_SoundStyle = LBD_RandomFromRange(0, 9) LBD_Configuration_SoundFormat = 0 LBD_Configuration_SoundTooltip = "Speak the CAPTCHA code" LBD_Configuration_SoundIconUrl = "BotDetect/SoundIcon.gif" LBD_Configuration_SoundPackageFolder = "C:\Program Files (x86) \Lanapsoft\BotDetect 3 CAPTCHA Component\Asp\Redistribute\BotDetectSounds" LBD_Configuration_WarnAboutMissingSoundPackages = True ' Captcha reload configuration ' --------------------------------------------------------------------- LBD_Configuration_ReloadEnabled = True LBD_Configuration_ReloadTooltip = "Reload the CAPTCHA code" LBD_Configuration_ReloadIconUrl = "BotDetect/ReloadIcon.gif" LBD_Configuration_AutoReloadExpiredCaptchas = True LBD_Configuration_AutoReloadTimeout = 7200 ' Captcha user input configuration ' --------------------------------------------------------------------- LBD_Configuration_AutoFocusInput = True LBD_Configuration_AutoClearInput = True LBD_Configuration_AutoLowercaseInput = True ' Captcha persistence configuration ' --------------------------------------------------------------------- Dim LBD_Persistence : Set LBD_Persistence = Session LBD_Configuration_UseApplicationFallback = True %>
Current BotDetect Versions
- BotDetect PHP CAPTCHA v3.0.Alpha12012–02–06
- BotDetect ASP.NET CAPTCHA v3.0.92011–11–21
- BotDetect ASP Classic CAPTCHA v3.0.92011–11–21




