RegionCode Property

The RegionCode property returns the region code associated with the IP address of the currently initialized CountryHawk object, or the region code associated with the two-letter country code, if passed in as the optional parameter. The return value is always in lowercase. See the section on Defining Regions for more information on how region codes are defined.

Syntax:

 countryRegion = chObj.RegionCode [codeToLookup]

Returns:

If the codeToLookup parameter is omitted, this property returns a string equal to the region code associated with the IP address of the currently initialized CountryHawk object.

If the codeToLookup parameter is specified, this property returns a string equal to the region code associated with the two-letter country code specified by the codeToLookup parameter.

Example:

set chObj = Server.CreateObject("cyScape.countryObj")

response.write "Your region code is: " & chObj.RegionCode

response.write "The region code for Germany is: " & chObj.RegionCode "DE"

See the ch_basics.asp, ch_statsByRegion.asp, and ch_statsByCountry.asp samples for more information.

Note: This property is read-only.

Note: Use of this property requires the Enterprise Edition of CountryHawk.

See Also:

About the Properties and Methods Guide

IPAddr property

Initialize method

CountryName method

RegionName Method

GetSelectList method

IsValidIP method

IsRestricted method

RegionNameFromCountryCode Method

IsInList method

About the sample scripts