BotDetect ASP Classic CAPTCHA Web API Reference (BotDetect ASP v4.x; discontinued)

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 classes and helper declarations.

  • BotDetect\CaptchaIncludes.asp

    BotDetect\CaptchaIncludes.asp

    The BotDetect\CaptchaIncludes.asp file includes the VbScript Captcha, CaptchaCode and BDC_CaptchaConfiguration 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\CaptchaIncludes.asp Captcha Class Reference
    BotDetect\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.asp Captcha 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\CaptchaIncludes.asp Captcha Class public property Property Get/Let UserInputID Captcha user input textbox identifier used for all server-side and client-side user input processing. The default value is empty (must be set for each Captcha individually). Valid user Captcha user input id setting values are strings corresponding to the Html identifier of the Captcha code input control on the form. Each Captcha instance should have an associated user input control.
    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let CodeLength Number of characters in randomly generated Captcha codes (answers to Captcha challenges). The default value is random (4-6 characters).
    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let CodeStyle

    Character types used to generate random Captcha codes. The default value is Alphanumeric.

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get/Let DisallowedCodeSubstrings

    Strings that should never occur in randomly generated Captcha codes. Can be both single characters (allows Captcha character set customization) and sequences of two or more characters (useful for swear words filtering, avoiding particular hard-to-read sequences etc.). The default value is empty (Captcha code filtering is optional).

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let CodeTimeout The time period after random Captcha code generation during which Captcha challenges based on it can be solved: when it expires, even correct inputs will be considered as invalid submissions. The default value is 1200 seconds (20 minutes).
    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let ImageStyle

    The BotDetect drawing algorithm used to render Captcha codes in image Captcha challenges.The default value is random (an image style is chosen from all available values for each Captcha image generated).

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get/Let ImageFormat

    Image format in which Captcha images will be generated and sent to the client. The default value is Jpeg.

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get/Let SoundEnabled

    Are Captcha sounds enabled.

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get/Let SoundStartDelay

    Starting delay (in milliseconds) of Captcha audio JavaScript playback. The default value is 0 (no delay).

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get/Let ImageTooltip

    The alternative text of the Captcha image Html element. The default value is "Retype the CAPTCHA code from the image".

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

    Tooltip of the Captcha sound icon.

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

    Tooltip of the Captcha reload icon.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let HelpLinkText

    Text or tooltip of the Captcha help link, depending on help link mode. The default value depends on the width of the Captcha image.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let HelpLinkUrl

    Url of the localized Captcha help page the help link points to. The default value depends on Captcha locale.

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

    Is Captcha reloading enabled.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let UseSmallIcons

    Default BotDetect Captcha icons are 22x22 pixels large, but there is also a smaller set of 17x17 px icons used when the default ones are too large.

    This settings allows you to control which icon set will be used.

    The default value is true when the Captcha image height is < 50px, and false otherwise.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let UseHorizontalIcons

    BotDetect displays the Captcha sound and reload icon one below the other by default, and switches to displaying them one beside the other when Captcha images are small enough. This setting allows you to control which BotDetect icon layout will be used.

    The default value is true when the Captcha image height is <40px, and false otherwise.

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

    Url of the icon used for Captcha sound playback.

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

    Url of the icon used for Captcha reloading.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let IconsDivWidth

    Custom width of the Captcha icons div element.

    The default value depends on Captcha image height, since BotDetect will automatically determine default icon size and position to match it.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let HelpLinkEnabled

    Will Captcha markup include a link to a Captcha help page providing Captcha instructions and explanations for form users.

    The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let HelpLinkMode

    How will the Captcha help link be displayed. The default value is Text.

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get/Let AdditionalCssClasses

    User-defined CSS classes that will be added to the BotDetect CAPTCHA container <div >.The default value is empty.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AdditionalInlineCss

    User-defined CSS style declarations that will be added as inline style of the BotDetect CAPTCHA container <div >. The default value is empty.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AddScriptInclude

    Should the BotDetect JavaScript client-side script code be included by the generated Captcha container markup. The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AddInitScript

    Should the JavaScript code for BotDetect client-side object creation be included in the generated Captcha container markup. The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AutoUppercaseInput

    Should user Captcha code input be automatically uppercased on the fly. The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AutoFocusInput

    Should the Captcha code input textbox automatically 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.

    The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AutoClearInput

    Should the Captcha user input textbox automatically be cleared on all reload icon clicks and auto-reloads of expired Captcha codes.

    The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AutoReloadExpiredCaptchas

    Should Captcha challenges automatically be reloaded when the Captcha code expires (controlled by the CodeTimeout property).

    The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let AutoReloadTimeout

    Time period in seconds after which automatic reloading of expired Captcha challenges will cease.

    The default value is 7200 seconds (2 hours).

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get/Let RemoteScriptEnabled

    Should BotDetect also add a remote JavaScript include (remote.captcha.com/include.js) loaded from the captcha.com server (which is currently used only for stats, but is planned to develop into additional Captcha functionality).

    The default value is true.

    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get IsSolved

    Has the current Captcha instance been successfully validated already.

    BotDetect\CaptchaIncludes.asp Captcha Class public subroutine Sub Reset Resets the IsSolved status of the current Captcha object instance.
    BotDetect\CaptchaIncludes.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 CaptchaConfig.asp file).
    BotDetect\CaptchaIncludes.asp Captcha Class public subroutine Sub SaveCaptchaCode
    • p_Code
    Saves the given Captcha code value in ASP Session state.
    BotDetect\CaptchaIncludes.asp Captcha Class public subroutine Sub DeleteCaptchaCode
    • p_InstanceID
    Deletes the Captcha code associated with the given instance identifier.
    BotDetect\CaptchaIncludes.asp Captcha Class public function Function LoadCaptchaCode
    • p_InstanceID
    Loads the saved Captcha code associated with the given instance identifier.
    BotDetect\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public function Function GenerateImage Generate the Captcha image, using the settings configured in the current Captcha object instance.
    BotDetect\CaptchaIncludes.asp Captcha Class public function Function GenerateSound Generate the Captcha sound, using the settings configured in the current Captcha object instance.
    BotDetect\CaptchaIncludes.asp Captcha Class public property Property Get ImageMimeType

    Image format MIME type for the currently configured image format.

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

    Sound format MIME type for the currently configured sound format.

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

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

    BotDetect\CaptchaIncludes.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 example project Free version information or not.

    BotDetect\CaptchaIncludes.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\CaptchaIncludes.asp Captcha Class public property Property Get ControlInfo

    Debugging helper, returning the assembly version of the Captcha COM component.

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

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

    BotDetect\CaptchaIncludes.asp Captcha BDC_CaptchaConfiguration Reference
    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidCodeLength
    • p_Value

    Valid user Captcha code length setting values are integers larger than 0 and smaller than 16.

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidCodeStyle
    • p_Value

    Valid user Captcha code style setting values are members of the BotDetect CodeStyle enumeration (Alpha, Numeric, or Alphanumeric).

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidDisallowedCodeSubstrings
    • p_Value

    Valid user disallowed Captcha code substring setting values are lists of arbitrary strings, in CSV format. Whitespace is ignored, and disallowed substrings are not case-sensitive (because Captcha codes are case-insensitive as well).

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidCodeTimeout
    • p_Value

    Valid user Captcha code timeout setting values are integers larger than 30 and smaller than 7200 (i.e. between half a minute and 2 hours).

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidImageStyle
    • p_Value

    Valid user Captcha image style setting values are members of the BotDetect ImageStyle enumeration. Please note that some image styles are restricted to paid versionss of BotDetect, and will be ignored in free version implementations.

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidImageWidth
    • p_Value

    Valid user Captcha image size setting values are integers: widths can be between 20 and 500 pixels.

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidImageHeight
    • p_Value

    Valid user Captcha image size setting values are integers: heights between 20 and 200 pixels.

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidImageFormat
    • p_Value

    Valid user Captcha image format setting values are members of the BotDetect ImageFormat enumeration (Jpeg, Png, Gif).

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidCustomDarkColor
    • 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\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidCustomLightColorValid
    • 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\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidSoundStyle
    • p_Value

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

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidSoundFormat
    • p_Value

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

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidSoundStartDelay
    • p_Value

    Valid user Captcha sound start delay setting values are positive integers.

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidSoundRegenerationMode
    • p_Value

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

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidLocale
    • 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\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidHelpLinkEnabled
    • p_Value

    Valid user help link enabled setting values are booleans.

    BotDetect\CaptchaIncludes.asp BDC_CaptchaConfiguration Class public function Function IsValidHelpLinkMode
    • p_Value

    Valid user Captcha help link mode setting values are members of the BotDetect HelpLinkMode enumeration ("Image" or "Text").

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

    BotDetect\CaptchaIncludes.asp CaptchaCode Class Reference
    BotDetect\CaptchaIncludes.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\CaptchaIncludes.asp CaptchaCode Class public property Property Get Code

    Returns the contained Captcha code string.

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

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

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

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

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

    BotDetect\CaptchaIncludes.asp Randomization Functions Reference
    BotDetect\CaptchaIncludes.asp Captcha Library randomization function Function BDC_RandomCodeStyle

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

    BotDetect\CaptchaIncludes.asp Captcha Library randomization function Function BDC_RandomCodeStyleFrom
    • codeStyleNames

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

    BotDetect\CaptchaIncludes.asp Captcha Library randomization function Function BDC_RandomImageStyle

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

    BotDetect\CaptchaIncludes.asp Captcha Library randomization function Function BDC_RandomImageStyleFrom
    • imageStyleNames

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

    BotDetect\CaptchaIncludes.asp Captcha Library randomization function Function BDC_RandomSoundStyle

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

    BotDetect\CaptchaIncludes.asp Captcha Library randomization function Function BDC_RandomSoundStyleFrom
    • soundStyleNames

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

    BotDetect\CaptchaIncludes.asp Utility Reference
    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_CodeStyleNames(0) = "Alphanumeric".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_CodeStyles("Alphanumeric") = 0.

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_ImageStyleNames(31) = "Chess".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_ImageStyles("Chalkboard") = 31.

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_ImageFormatNames(0) = "JPEG".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_ImageFormats("Jpeg") = 0.

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_SoundStyleNames(0) = "Dispatch".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_SoundStyles("Dispatch") = 0.

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_SoundFormatNames(0) = "WavPcm16bit8kHzMono".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_SoundRegenerationModes( "None") = 0.

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_SoundRegenerationModeNames(0) = "None".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_SoundFormats( "WavPcm16bit8kHzMono") = 0.

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_HelpLinkModeNames(0) = "Image".

    BotDetect\CaptchaIncludes.asp Captcha Library Utility BDC_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. BDC_HelpLinkModes("Image") = 0.

    BotDetect\Utils.asp Captcha utility function Function BDC_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 BDC_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 BDC_Now

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

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

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

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

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

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

    Removes all whitespace chars from the given string.

    BotDetect\Utils.asp Captcha utility function Function BDC_CreateGuid

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

    BotDetect\Utils.asp Captcha utility function Function BDC_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 BDC_RandomFromRange
    • p_LowerLimit
    • p_UpperLimit

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

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

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

    Returns a random value from the given VbScript Array.

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

    BotDetect\Utils.asp Captcha utility function Function BDC_ScriptName

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

    BotDetect\Utils.asp Captcha utility function Function BDC_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.

    BotDetect\Utils.asp Captcha utility function Function BDC_IsLocalRequest

    BotDetect\Utils.asp Captcha utility function Function BDC_GetAspCode
    • p_AspCodeFile

    BotDetect\Utils.asp Captcha utility function Function BDC_ExecuteIfExists
    • p_AspCodeFile

    CaptchaConfig.asp

    The 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 Application Config Settings classic ASP code example.

    CaptchaConfig.asp configuration value BotDetect.CodeLength = BDC_RandomFromRange(3, 5)

    Number of characters in randomly generated Captcha codes (answers to Captcha challenges).

    CaptchaConfig.asp configuration value BotDetect.CodeStyle = BDC_CodeStyles("Alpha")

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

    CaptchaConfig.asp configuration value BotDetect.DisallowedCodeSubstrings = "d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w"

    Strings that should never occur in randomly generated Captcha codes. Can be both single characters (allows Captcha character set customization) and sequences of two or more characters (useful for swear words filtering, avoiding particular hard-to-read sequences etc.).

    CaptchaConfig.asp configuration value BotDetect.CodeTimeout = 600

    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.

    CaptchaConfig.asp configuration value BotDetect.TestModeEnabled = False

    Application configuration switch to use if you want to run automated tests that need to be able to submit a Captcha-protected form in QA environments.

    CaptchaConfig.asp configuration value BotDetect.ImageStyle = BDC_RandomImageStyleFrom(imageStyleNames)

    The BotDetect drawing algorithm used to render Captcha codes in image Captcha challenges.

    CaptchaConfig.asp configuration value BotDetect.ImageWidth = 200

    Captcha image width, in pixels.

    CaptchaConfig.asp configuration value BotDetect.ImageHeight = 50

    Captcha image height, in pixels.

    CaptchaConfig.asp configuration value BotDetect.ImageFormat = BDC_ImageFormats("PNG")

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

    CaptchaConfig.asp configuration value BotDetect.CustomDarkColor = "#483d8b"

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

    CaptchaConfig.asp configuration value BotDetect.CustomLightColor = "#87cefa"

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

    CaptchaConfig.asp configuration value BotDetect.DisabledImageStyles = "Chipped,Lego,Wave"

    Application configuration setting that allows centralized temporary disabling of individual BotDetect image styles if there is ever an urgent issue that requires it.

    CaptchaConfig.asp configuration value BotDetect.SoundEnabled = True

    Is Captcha sound enabled.

    CaptchaConfig.asp configuration value BotDetect.SoundStyle = BDC_RandomSoundStyleFrom(soundStyleNames)

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

    CaptchaConfig.asp configuration value BotDetect.SoundFormat = BDC_SoundFormats("WavPcm8bit8kHzMono")

    Captcha sound output format (WavPcm16bit8KhzMono or WavPcm8bit8KhzMono).

    CaptchaConfig.asp configuration value BotDetect.SoundRegenerationMode = BDC_SoundRegenerationModes("None")

    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.

    CaptchaConfig.asp configuration value BotDetect.SoundPackagesFolder = "C:\Program Files (x86)\BotDetect 4 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.

    CaptchaConfig.asp configuration value BotDetect.WarnAboutMissingSoundPackages = False

    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".

    CaptchaConfig.asp configuration value BotDetect.DisabledSoundStyles = "RedAlert,HiveMind"

    Application configuration setting that allows centralized temporary disabling of individual BotDetect sound styles if there is ever an urgent issue that requires i.

    CaptchaConfig.asp configuration value BotDetect.Locale = "en-US"

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

    CaptchaConfig.asp configuration value BotDetect.ImageTooltip = "Custom Captcha image tooltip"

    Custom Captcha image alt text / title.

    CaptchaConfig.asp configuration value BotDetect.SoundTooltip = "Custom Captcha sound icon tooltip"

    Custom sound Captcha icon alt text / title.

    CaptchaConfig.asp configuration value BotDetect.ReloadTooltip = "Custom Captcha reload icon tooltip"

    Custom reload Captcha icon alt text / title.

    CaptchaConfig.asp configuration value BotDetect.HelpLinkText = "Custom Captcha help link text"

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

    CaptchaConfig.asp configuration value BotDetect.HelpLinkUrl = "custom-captcha-help-page.html"

    Url to which the Captcha help link points to.

    CaptchaConfig.asp configuration value BotDetect.ReloadEnabled = False

    Is Captcha reloading enabled.

    CaptchaConfig.asp configuration value BotDetect.UseSmallIcons = False

    Default BotDetect Captcha icons are 22x22 pixels large, but there is also a smaller set of 17x17 px icons used when the default ones are too large. This settings allows you to control which icon set will be used.

    CaptchaConfig.asp configuration value BotDetect.UseHorizontalIcons = False

    BotDetect displays the Captcha sound and reload icon one below the other by default, and switches to displaying them one beside the other when Captcha images are small enough. This setting allows you to control which BotDetect icon layout will be used.

    CaptchaConfig.asp configuration value BotDetect.SoundIconUrl = "custom-sound-icon.gif"

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

    CaptchaConfig.asp configuration value BotDetect.ReloadIconUrl = "BotDetect/Public/bdc-reload-icon.gif"

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

    CaptchaConfig.asp configuration value BotDetect.IconsDivWidth = 25

    Custom width of the Captcha icons div element.

    CaptchaConfig.asp configuration value BotDetect.HelpLinkEnabled = True

    Is the Captcha help link enabled or not.

    CaptchaConfig.asp configuration value BotDetect.HelpLinkMode = BDC_HelpLinkModes("Text")

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

    CaptchaConfig.asp configuration value BotDetect.AdditionalCssClasses = "class1 class2 class3"

    User-defined CSS classes that will be added to the BotDetect CAPTCHA container <div >.

    CaptchaConfig.asp configuration value BotDetect.AdditionalInlineCss = "border: 4px solid #fff; background-color: #f8f8f8;"

    User-defined CSS style declarations that will be added as inline style of the BotDetect CAPTCHA container <div >.

    CaptchaConfig.asp configuration value BotDetect.AddInitScript = True

    Should the JavaScript code for BotDetect client-side object creation be included in the generated Captcha container markup.

    CaptchaConfig.asp configuration value BotDetect.AddScriptInclude = False

    Should the BotDetect JavaScript client-side script code be included by the generated Captcha container markup.

    CaptchaConfig.asp configuration value BotDetect.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.

    CaptchaConfig.asp configuration value BotDetect.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.

    CaptchaConfig.asp configuration value BotDetect.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.

    CaptchaConfig.asp configuration value BotDetect.AutoReloadExpiredCaptchas = True

    Captcha images are automatically reloaded when the Captcha code expires (as set in the BDC_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).

    CaptchaConfig.asp configuration value BotDetect.AutoReloadTimeout = 3600

    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).

    CaptchaConfig.asp configuration value BotDetect.SoundStartDelay = 1000

    Captcha sound JavaScript playback starting delay, in milliseconds.

    CaptchaConfig.asp configuration value BotDetect.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.

    CaptchaConfig.asp configuration value BDC_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.

    CaptchaConfig.asp configuration value Set BotDetect.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.

    CaptchaConfig.asp configuration value BotDetect.UseApplicationStorageFallback = 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.


    Please Note

    The information on this page applies to a discontinued version of BotDetect™ ASP CAPTCHA (v4.x)