BotDetect ASP Classic CAPTCHA Web API Reference (BotDetect v3.0; deprecated)

To make Captcha integration into ASP Classic applications easy, the BotDetect ASP Captcha component wraps the basic Captcha functionality implemented in the Captcha COM component with a simple ASP Classic Captcha library. This library is focused on ease of use from Classic ASP applications, and includes a number of .asp files with VbScript class and helper declarations.

BotDetect\CaptchaClass.asp

The BotDetect\CaptchaClass.asp file includes the VbScript Captcha and CaptchaCode class declarations, and some helper functions. These classes and functions are at the core of the BotDetect ASP Captcha Library.

Instances of the Captcha type can be created on your ASP forms and will take care of Captcha display and validation.

BotDetect\CaptchaClass.asp Captcha Class Reference
BotDetect\CaptchaClass.asp Captcha Class public function Default Function Init
  • captchaId
Instead of using the constructor, Captcha objects should always be created using the default Init function, which takes the Captcha identifier (a string) as parameter and automatically initializes the instance identifier.
BotDetect\CaptchaClass.asp Captcha Class public function Default Function Init
  • Array(p_CaptchaId, p_InstanceId

The same function can also be used to create a Captcha VbScript object instance with the given Captcha identifier and instance identifier (sent as an Array).

This is used to reference data for a previous object instance, for example when generating Captcha images and sounds in the BotDetect\CaptchaHandler.asp source.

This "overload" of the Init function is not used directly when implementing the default Captcha library behavior, only when making significant customizations in the BotDetect source.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get CaptchaID Unique identifier of the Captcha object within the application (for example, if you placed one Captcha object on the Registration page and another on the Contact Us page, they would have distinct CaptchaId values).
BotDetect\CaptchaClass.asp Captcha Class public property Property Get InstanceID Globally unique identifier of the current Captcha object instance, used to ensure each page load keeps separate Captcha codes, for example when opening the same form in multiple browser tabs.
BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let Locale Locale string, affects the character set used for Captcha code generation and the pronunciation language used for Captcha sound generation
BotDetect\CaptchaClass.asp Captcha Class public function Function IsLocaleValid
  • p_Value

Validates the given Locale string, checking it's not empty or too short to be a valid locale specification.

Since the locale strings supported by BotDetect will change depending on the underlying COM component version and sound package files available, this function doesn't perform any comprehensive locale checks.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let CodeLength Length (number of characters) of the Captcha code rendered; the default value is 5.
BotDetect\CaptchaClass.asp Captcha Class public function Function IsCodeLengthValid
  • p_Value

Validates the given code length, checking that it's a number between 1 and 15.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let CodeStyle

Numeric representation of the Captcha code style, i.e. the algorithm used to generate Captcha codes from default pre-defined locale character sets; the default value is 0.

This value is persisted if needed and directly propagated to the COM Captcha component interface.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let CodeStyleName

String representation of the Captcha

This value is converted to its numerical representation before it's actually used, so the string property is just a helper to make your ASP code more readable.

BotDetect\CaptchaClass.asp Captcha Class public function Function IsCodeStyleValid
  • p_Value

Validates the given numeric code style value, checking that it's a number between 0 and 2.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let CodeTimeout Period (in seconds) during which each generated Captcha code can be validated after generation; the default value is 1200 seconds (20 minutes).
BotDetect\CaptchaClass.asp Captcha Class public function Function IsCodeTimeoutValid
  • p_Value

Validates the given code timeout, checking that it's a number between 30 and 1200.

Code timeouts longer than 20 minutes are considered invalid since the default Classic ASP Session timeout is 20 minutes, and setting a longer code timeout wouldn't work without increasing the Session timeout first.

If you increase your server's ASP Session state timeout, you can also change the validation function upper bound.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ImageStyle

Numeric representation of the Captcha image style, i.e. the algorithm used to render Captcha codes in images; the default image style is 31.

This value is persisted if needed and directly propagated to the COM Captcha component interface.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ImageStyleName

String representation of the Captcha image style, i.e. the algorithm used to render Captcha codes in images.

This value is converted to its numerical representation before it's actually used, so the string property is just a helper to make your ASP code more readable.

BotDetect\CaptchaClass.asp Captcha Class public function Function IsImageStyleValid
  • p_Value

Validates the given numeric image style value, checking that it's a number between 0 and 49.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ImageWidth Width of the generate Captcha image, in pixels; the default Captcha image width is 250 px.
BotDetect\CaptchaClass.asp Captcha Class public function Function IsImageWidthValid
  • p_Value

Validates the given image width value, checking that it's a number between 20 and 1000.

Captcha images smaller than 20 x 20 pixels are simply not supported, and the larger the image, the longer it takes to generate it and transfer it to the client.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ImageHeight Height of the generate Captcha image, in pixels; the default Captcha image height is 50 px.
BotDetect\CaptchaClass.asp Captcha Class public function Function IsImageHeightValid
  • p_Value

Validates the given image height value, checking that it's a number between 20 and 1000.

Captcha images smaller than 20 x 20 pixels are simply not supported, and the larger the image, the longer it takes to generate it and transfer it to the client.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ImageFormat

Numeric representation of the image format in which the Captcha image will be generated; the default format is 0.

This value is persisted if needed and directly propagated to the COM Captcha component interface.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ImageFormatName

String representation of the

This value is converted to its numerical representation before it's actually used, so the string property is just a helper to make your ASP code more readable.

BotDetect\CaptchaClass.asp Captcha Class public function Function IsImageFormatValid
  • p_Value

Validates the given numeric code style value, checking that it's a number between 0 and 3.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let CustomDarkColor Optional custom dark color point, modifies the color palette used for Captcha image drawing. Should be a Html color, i.e. specified either by name ("Red") or hex value ("#f00" or "#ff0000")
BotDetect\CaptchaClass.asp Captcha Class public function Function IsCustomDarkColorValid
  • p_Value

Validates the given string custom dark color value, checking that it's not an empty string.

The Classic ASP Captcha library doesn't check that the given value is a valid Html color value, but the underlying COM implementation will throw an error if an invalid value is specified.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let CustomLightColor Optional custom light color point, modifies the color palette used for Captcha image drawing. Should be a Html color, i.e. specified either by name ("Red") or hex value ("#f00" or "#ff0000")
BotDetect\CaptchaClass.asp Captcha Class public function Function IsCustomLightColorValid
  • p_Value

Validates the given string custom light color value, checking that it's not an empty string.

The Classic ASP Captcha library doesn't check that the given value is a valid Html color value, but the underlying COM implementation will throw an error if an invalid value is specified.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundStyle

Numeric representation of the Captcha sound style, i.e. the algorithm used to pronounce Captcha codes in sounds; the default sound style is 0.

This value is persisted if needed and directly propagated to the COM Captcha component interface.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundStyleName

String representation of the Captcha

This value is converted to its numerical representation before it's actually used, so the string property is just a helper to make your ASP code more readable.

BotDetect\CaptchaClass.asp Captcha Class public function Function IsSoundStyleValid
  • p_Value

Validates the given numeric sound style value, checking that it's a number between 0 and 9.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundFormat

Numeric representation of the audio format in which the Captcha sound file will be generated; the default format is 0

This value is persisted if needed and directly propagated to the COM Captcha component interface.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundFormatName

String representation of the

This value is converted to its numerical representation before it's actually used, so the string property is just a helper to make your ASP code more readable.

BotDetect\CaptchaClass.asp Captcha Class public function Function IsSoundFormatValid
  • p_Value

Validates the given numeric sound format value, checking that it's a number between 0 and 1.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundRegenerationMode

Numeric representation of the sound regeneration mode determining how will multiple consecutive requests for audio Captcha with the same Captcha code be handled by BotDetect; the default mode is 1.

This value is persisted if needed and directly propagated to the COM Captcha component interface.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundRegenerationModeName

String representation of the

This value is converted to its numerical representation before it's actually used, so the string property is just a helper to make your ASP code more readable.

BotDetect\CaptchaClass.asp Captcha Class public function Function IsSoundRegenerationModeValid
  • p_Value

Validates the given numeric sound regeneration mode value, checking that it's a number between 0 and 2.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let UserInputID User input textbox client-side identifier, used for Captcha validation and all client-side user input processing, e.g. automatic user input lowercasing and focusing.
BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let TabIndex

Starting tabindex for the Captcha control Html output.

The keyboard-selectable Captcha markup elements are: the Captcha reload icon, the Captcha sound icon, and (only in the Free version of BotDetect) the BotDetect website link.

Depending on your settings (is Captcha reloading enabled, are Captcha sounds enabled) and the version of BotDetect you are using (free or paid), the next available tabindex on the page can be from 0 to 3 greater than this value.
BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundEnabled

Are Captcha sounds enabled.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundTooltip

Tooltip of the Captcha sound icon.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let SoundIconUrl

Url of the icon used for Captcha sound playback.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ReloadEnabled

Is Captcha reloading enabled.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ReloadTooltip

Tooltip of the Captcha reload icon.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get/Let ReloadIconUrl

Url of the icon used for Captcha reloading.

BotDetect\CaptchaClass.asp Captcha Class public subroutine Sub Save This subroutine saves the Captcha object instance state into ASP Session state, if needed (if the instance data is different from the application defaults defined in the BotDetect\CaptchaConfig.asp file).
BotDetect\CaptchaClass.asp Captcha Class public subroutine Sub SaveCaptchaCode
  • p_Code
Saves the given Captcha code value in ASP Session state.
BotDetect\CaptchaClass.asp Captcha Class public subroutine Sub DeleteCaptchaCode
  • p_InstanceID
Deletes the Captcha code associated with the given instance identifier.
BotDetect\CaptchaClass.asp Captcha Class public function Function LoadCaptchaCode
  • p_InstanceID
Loads the saved Captcha code associated with the given instance identifier.
BotDetect\CaptchaClass.asp Captcha Class public function Function Validate

Validate the Captcha code user input, relying on automatic instance identifier propagation through a hidden field, and the user input identifier set through the UserInputID property.

Used by default, if you're simply using the out-of-the-box Captcha object.

BotDetect\CaptchaClass.asp Captcha Class public function Function ValidateInstance
  • p_InstanceId
  • p_UserInput
Validate the Captcha code user input for the explicitly stated instance identifier and user input value. Used for Classic ASP Captcha customizations you might make.
BotDetect\CaptchaClass.asp Captcha Class public function Function AjaxValidate
  • p_InstanceId
  • p_UserInput
Validate the Captcha code user input for the explicitly stated instance identifier and user input value. Used for BotDetect built-in Ajax Captcha validation.
BotDetect\CaptchaClass.asp Captcha Class public property Property Get IsSolved

Has the current Captcha instance been successfully validated already.

BotDetect\CaptchaClass.asp Captcha Class public subroutine Sub Reset Resets the IsSolved status of the current Captcha object instance.
BotDetect\CaptchaClass.asp Captcha Class public function Function GenerateImage Generate the Captcha image, using the settings configured in the current Captcha object instance.
BotDetect\CaptchaClass.asp Captcha Class public function Function GenerateSound Generate the Captcha sound, using the settings configured in the current Captcha object instance.
BotDetect\CaptchaClass.asp Captcha Class public property Property Get ImageMimeType

Image format MIME type for the currently configured image format.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get SoundMimeType

Sound format MIME type for the currently configured sound format.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get SoundFilename

Sound file name for the current sound format and instance identifier.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get IsFree

License helper, telling whether the Captcha COM component instance is created by the free BotDetect version. Used to check whether to display the code sample Free version information or not.

BotDetect\CaptchaClass.asp Captcha Class public property Property Get IsSoundAvailable

Is the BotDetect pronunciation sound package for the currently used locale available in the specified sound packages folder.

BotDetect\CaptchaClass.asp Captcha Class public function Function Html Generates the Html markup needed to add the current Captcha object instance to an ASP form.
BotDetect\CaptchaClass.asp Captcha Class public function Function Info Generates debugging info about the current Captcha object instance.

Instances of the CaptchaCode type are used internally by the BotDetect Classic ASP Captcha Library.

BotDetect\CaptchaClass.asp CaptchaCode Class Reference
BotDetect\CaptchaClass.asp CaptchaCode Class public function Default Function Init
  • p_Value
Instead of using the constructor, CaptchaCode objects should always be created using the default Init function, which takes the Captcha code string and initializes the object fields.
BotDetect\CaptchaClass.asp CaptchaCode Class public property Property Get Code

Returns the contained Captcha code string.

BotDetect\CaptchaClass.asp CaptchaCode Class public property Property Get ElapsedSeconds

Calculates how many seconds have elapsed since the CaptchaCode object has been constructed.

BotDetect\CaptchaClass.asp CaptchaCode Class public property Property Get/Let GenerationTime

The CaptchaCode object construction time, used to calculate the Captcha code timeout.

The CaptchaClass.asp file also includes some helper functions related to the Captcha randomization functionality.

BotDetect\CaptchaClass.asp Randomization Functions Reference
BotDetect\CaptchaClass.asp Captcha Library randomization function Function LBD_RandomCodeStyle

Returns a Captcha CodeStyle value randomly chosen from all available values.

BotDetect\CaptchaClass.asp Captcha Library randomization function Function LBD_RandomCodeStyleFrom
  • codeStyleNames

Returns a Captcha CodeStyle value randomly chosen from the given array of CodeStyle names.

BotDetect\CaptchaClass.asp Captcha Library randomization function Function LBD_RandomImageStyle

Returns a Captcha ImageStyle value randomly chosen from all available values.

BotDetect\CaptchaClass.asp Captcha Library randomization function Function LBD_RandomImageStyleFrom
  • imageStyleNames

Returns a Captcha ImageStyle value randomly chosen from the given array of ImageStyle names.

BotDetect\CaptchaClass.asp Captcha Library randomization function Function LBD_RandomSoundStyle

Returns a Captcha SoundStyle value randomly chosen from all available values.

BotDetect\CaptchaClass.asp Captcha Library randomization function Function LBD_RandomSoundStyleFrom
  • soundStyleNames

Returns a Captcha SoundStyle value randomly chosen from the given array of SoundStyle names.

BotDetect\CaptchaConfig.asp

The BotDetect\CaptchaConfig.asp file contains the application default values used by the ASP Captcha library. You can modify various Captcha parameters simply by editing the values from this file in your Classic ASP websites.

You can see how some non-default values were set in this file in the Captcha customization classic ASP code sample.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_CodeLength = 5

Captcha code length, in characters.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_CodeStyle = LBD_CodeStyles("Alphanumeric")

Captcha code style (alphanumeric, alpha, or numeric).

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ CodeTimeout = 1200

Captcha code timeout in seconds - the Captcha can only be successfully solved within the specified time after generation.

This is an optional security improvement that narrows the window of opportunity for attacks based on re-using the Captcha image on another site controlled by the attacker, or similar human-solver-based attacks on Captcha-protected forms.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_Locale = "en-US"

Captcha locale string, affecting the charset used for Captcha code generation, and the pronunciation language used for sound Captchas.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ CustomCharset = ""

Defines a custom character set for Captcha code generation, specifying the alphanumeric characters which will be used for all Captcha codes regardless of the code style value set.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ BannedSequences = ""

Defines rules about character sequences you want to avoid using in randomly generated CAPTCHA codes. Must be a CSV string.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ImageStyle = 31

Captcha image style - can be a fixed or a randomized value selected from the 50 BotDetect image drawing algorithms.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ImageWidth = 250

Captcha image width, in pixels.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ImageHeight = 50

Captcha image height, in pixels.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ ImageFormat = LBD_ImageFormats("JPEG")

Captcha image output format (JPG, GIF, PNG or BMP).

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ CustomDarkColor = ""

Used to override the default Captcha image color scheme. Html named or hex color value of the dark color used in Captcha images.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ CustomLightColor = ""

Used to override the default Captcha image color scheme. Html named or hex color value of the light color used in Captcha images.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ ImageTooltip = "CAPTCHA"

Custom Captcha image alt text / title.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ HelpLinkEnabled = True

Is the Captcha help link enabled or not.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_HelpLinkMode = LBD_HelpLinkModes("Text")

Controls how the Captcha help link is displayed; supported modes are "Image" and "Text".

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_HelpLinkUrl = "https://captcha.com/asp-captcha-info.html"

Url to which the Captcha help link points to.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_HelpLinkText = ""

Text used in the Captcha help link; leave empty for default image width-dependent text.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ SoundEnabled = True

Is Captcha sound enabled.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_SoundStyle = 0

Captcha sound style - can be a fixed or a randomized value selected from the 10 BotDetect sound generation algorithms.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ SoundFormat = LBD_SoundFormats( "WavPcm16bit8kHzMono")

Captcha sound output format (WavPcm16bit8KhzMono or WavPcm8bit8KhzMono).

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ SoundTooltip = "Speak the CAPTCHA code"

Custom sound Captcha icon alt text / title.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ SoundIconUrl = "BotDetect/SoundIcon.gif"

Custom sound Captcha icon. You can use standard BotDetect icons ("BotDetect\SoundIcon.gif" and "BotDetect\SmallSoundIcon.gif") or an icon of your own.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ SoundPackageFolder = "C:\Program Files\Lanapsoft\BotDetect 3 CAPTCHA Component\Asp\ Redistribute\ BotDetectSounds"

Custom sound packages folder. You can reuse a single location for all ASP applications using BotDetect Captcha on the same server, as long as the IIS worker process running them had Read permissions to the location.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ WarnAboutMissingSound Packages = True

If the required SoundPackage in not deployed, the sound icon is not clickable and displays a warning tooltip by default.

If you want to disable this warning and simply not display the sound Captcha icon at all for locales whose pronunciations are not deployed with the application, set this property to "False".

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_SoundStartDelay = 0

Captcha sound JavaScript playback starting delay, in milliseconds.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ SoundRegenerationMode = LBD_SoundRegenerationModes("Limited")

How will multiple consecutive requests for audio Captcha with the same Captcha code ("sound regeneration") be handled by BotDetect - a trade-off of security, usability, and storage requirements.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ ReloadEnabled = True

Is Captcha reloading enabled.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ ReloadTooltip = "Change the CAPTCHA code"

Custom reload Captcha icon alt text / title.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ ReloadIconUrl = "BotDetect/ReloadIcon.gif"

Custom reload Captcha icon. You can use standard BotDetect icons ("BotDetect\ReloadIcon.gif" and "BotDetect\SmallReloadIcon.gif") or an icon of your own.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ AutoReloadExpiredCaptchas = True

Captcha images are automatically reloaded when the Captcha code expires (as set in the LBD_Configuration_CodeTimeout element, or the ASP Session timeout), but only within a certain interval from their first generation.

This allows you to have a short Captcha code timeout (e.g. 2 minutes) to narrow the window of opportunity for Captcha reusing on other sites or human-solver-powered bots, and actual visitors can still fill out your form at their own pace and without rushing (since the Captcha image will be reloaded automatically when it is no longer valid).

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ AutoReloadTimeout = 7200

Since we don't want infinite sessions when the user leaves the form open in a background browser tab over the weekend (for example), we set a reasonable upper limit on the auto-reload period (e.g. 2 hours = 7200 seconds).

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ AutoFocusInput = True

The input textbox will be assigned focus on all Captcha Sound and Captcha Reload icon clicks, allowing the users to more easily type in the code as they hear it or as the new image loads.

This does not apply to auto-reloading of expired Captchas, since the user might be filling out another field on the form when the auto-reload starts and shouldn't be distracted.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ AutoClearInput = True

The input textbox will be cleared on all Reload icon clicks and auto-reloads, since any previous input in the textbox will be invalidated by Captcha reloading.

This is a small usability improvement that helps users avoid having to delete the previous input themselves.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ AutoUppercaseInput = True

Anything the users type in the input textbox will be uppercased on the fly, since Captcha validation is not and should not be case-sensitive.

This is a small usability improvement that helps communicate that fact to the users clearly.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ RemoteScriptEnabled = True

By default, BotDetect also adds a remote JavaScript include loaded from the captcha.com server, which is currently used only for stats, but is planned to develop into additional Captcha functionality. This include can be disabled using this configuration property.

BotDetect\CaptchaConfig.asp configuration value Dim LBD_Persistence : Set LBD_Persistence = Session

By default, BotDetect stores generated Captcha codes and per-instance set values in ASP Session state. If you want to change the persistence medium and use your own dictionary-type object, this is the setting to use.

BotDetect\CaptchaConfig.asp configuration value LBD_Configuration_ UseApplicationFallback = True

Controls whether data required for sound Captcha playback will also be saved in ASP Application state, as a fallback for ASP Session state problems.

Several browser/sound player combinations cause sound problems since they misplace ASP Session cookies when transferring the sound Url to the sound player (IE 7.0 + WMP 11, Safari 4 + QuickTime, etc.).

Keeping this option set to True makes sound Captchas play correctly even in such clients, at the cost of some server memory and slower execution due to Application state locking/unlocking necessary.

BotDetect\Utils.asp

The BotDetect\Utils.asp file from the BotDetect Classic ASP Captcha library contains some helper functions and values, which you can also use in your ASP applications if you need them. Some helpers are BotDetect- and Captcha-specific, while others are general-purpose ASP utilities.

BotDetect\Utils.asp Captcha utility value LBD_CodeStyleNames

A VbScript Array, containing all BotDetect code style names. String values are mapped by their numeric equivalents as indexes, so you can get a code style name by passing the numeric value as array index.

E.g. LBD_CodeStyleNames(0) = "Alphanumeric".

BotDetect\Utils.asp Captcha utility value LBD_CodeStyles

A VbScript Dictionary, containing all BotDetect code style numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get a code style numeric value by passing the string name as dictionary key.

E.g. LBD_CodeStyles("Alphanumeric") = 0.

BotDetect\Utils.asp Captcha utility value LBD_ImageStyleNames

A VbScript Array, containing all BotDetect image style names. String values are mapped by their numeric equivalents as indexes, so you can get an image style name by passing the numeric value as array index.

E.g. LBD_ImageStyleNames(31) = "Chess".

BotDetect\Utils.asp Captcha utility value LBD_ImageStyles

A VbScript Dictionary, containing all BotDetect image style numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get an image style numeric value by passing the string name as dictionary key.

E.g. LBD_ImageStyles("Chalkboard") = 31.

BotDetect\Utils.asp Captcha utility value LBD_ImageFormatNames

A VbScript Array, containing all BotDetect image format names. String values are mapped by their numeric equivalents as indexes, so you can get an image format name by passing the numeric value as array index.

E.g. LBD_ImageFormatNames(0) = "JPEG".

BotDetect\Utils.asp Captcha utility value LBD_ImageFormats

A VbScript Dictionary, containing all BotDetect image format numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get an image format numeric value by passing the string name as dictionary key.

E.g. LBD_ImageFormats("Jpeg") = 0.

BotDetect\Utils.asp Captcha utility value LBD_SoundStyleNames

A VbScript Array, containing all BotDetect sound style names. String values are mapped by their numeric equivalents as indexes, so you can get a sound style name by passing the numeric value as array index.

E.g. LBD_SoundStyleNames(0) = "Dispatch".

BotDetect\Utils.asp Captcha utility value LBD_SoundStyles

A VbScript Dictionary, containing all BotDetect sound style numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get a sound style numeric value by passing the string name as dictionary key.

E.g. LBD_SoundStyles("Dispatch") = 0.

BotDetect\Utils.asp Captcha utility value LBD_SoundFormatNames

A VbScript Array, containing all BotDetect sound format names. String values are mapped by their numeric equivalents as indexes, so you can get a sound format name by passing the numeric value as array index.

E.g. LBD_SoundFormatNames(0) = "WavPcm16bit8kHzMono".

BotDetect\Utils.asp Captcha utility value LBD_SoundRegenerationModes

A VbScript Dictionary, containing all BotDetect sound regeneration mode numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get a sound regeneration mode numeric value by passing the string name as dictionary key.

E.g. LBD_SoundRegenerationModes( "None") = 0.

BotDetect\Utils.asp Captcha utility value LBD_SoundRegenerationModeNames

A VbScript Array, containing all BotDetect sound regeneration mode names. String values are mapped by their numeric equivalents as indexes, so you can get a sound regeneration mode name by passing the numeric value as array index.

E.g. LBD_SoundRegenerationModeNames(0) = "None".

BotDetect\Utils.asp Captcha utility value LBD_SoundFormats

A VbScript Dictionary, containing all BotDetect sound format numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get a sound format numeric value by passing the string name as dictionary key.

E.g. LBD_SoundFormats( "WavPcm16bit8kHzMono") = 0.

BotDetect\Utils.asp Captcha utility value LBD_HelpLinkModeNames

A VbScript Array, containing all BotDetect help link mode names. String values are mapped by their numeric equivalents as indexes, so you can get a sound format name by passing the numeric value as array index.

E.g. LBD_HelpLinkModeNames(0) = "Image".

BotDetect\Utils.asp Captcha utility value LBD_HelpLinkModes

A VbScript Dictionary, containing all BotDetect help link mode numeric values. Numeric values are mapped by their (case-insensitive) string equivalents as keys, so you can get a sound format numeric value by passing the string name as dictionary key.

E.g. LBD_HelpLinkModes("Image") = 0.

BotDetect\Utils.asp Captcha utility function Function LBD_Timestamp

Creates a simple timestamp string based on the current date and time, e.g. on the 21st of September at 13:45:27 it would return 20100921134527.

BotDetect\Utils.asp Captcha utility function Function LBD_FormattedDate
  • p_Date

Formats the given date/time value in the YYYY/MM/DD hh:mm:ss format for logging & troubleshooting purposes.

BotDetect\Utils.asp Captcha utility function Function LBD_Now

Automatically uses the LBD_FormattedDate formatting on the current date/time.

BotDetect\Utils.asp Captcha utility function Function LBD_Asciify
  • p_Input

Replaces all non-Ascii characters in the given string with '?'.

BotDetect\Utils.asp Captcha utility function Function LBD_Normalize
  • p_Input

Removes all non-word (word characters = alphanumeric Ascii + underscore) characters from the given string.

BotDetect\Utils.asp Captcha utility function Function LBD_CreateGuid

Creates a new GUID value, formatted as a continuous string (e.g. 9DAA001BF32B4B32AE741B109922ECC5).

BotDetect\Utils.asp Captcha utility function Function LBD_DictionaryFromArray
  • p_Array

Given an array of values, converts it to a VbScript Dictionary, with the array values becoming dictionary keys and array indexes becoming dictionary values.

In other words, it reverses the array [index -> value] mapping, creating the equivalent [value -> index] dictionary mapping.

BotDetect\Utils.asp Captcha utility function Function LBD_RandomFromRange
  • p_LowerLimit
  • p_UpperLimit

Returns a random integer from the numeric range defined by the given (inclusive) lower and upper bound.

E.g. LBD_RandomFromRange(1, 5) could randomly return 1, 2, 3, 4 or 5.

BotDetect\Utils.asp Captcha utility function Function LBD_RandomFromValues
  • p_Values

Returns a random value from the given VbScript Array.

E.g. LBD_RandomFromValues(Array("one", "two", "three")) could randomly return "one", "two" or "three".

BotDetect\Utils.asp Captcha utility function Function LBD_ScriptName

Name of the currently executing script file, e.g. returns "Default" when called from Default.asp.

BotDetect\Utils.asp Captcha utility function Function LBD_AppName

Name of the next-to-last path fragment for the currently executing script file, e.g. returns "Folder2" when called from http://localhost/Folder1/ Folder2/Default.asp.


Please Note

The information on this page is out of date and applies to a deprecated version of BotDetect™ CAPTCHA (v3.0).

An up-to-date equivalent page for the latest BotDetect Captcha release (v4) is BotDetect v4 Captcha documentation index.

General information about the major improvements in the current BotDetect release can be found at the What's New in BotDetect v4.0 page.