GetRegion Method (.NET)

 

The GetRegion method is used to return the immutable instance of the RegionObj class associated with a particular IP address. Once you have the CountryObj instance you can then get information associated with the IP address, including the country or origin, country name, and total number of hits from that country. This is a static method.

Syntax:

 regObj = RegionObj.GetRegion (countryCode)

Returns the immutable CountryObj instance for the specified countryCode parameter. This parameter must be a valid two-letter country code.

 regObj = RegionObj.GetRegion (countryObj)

Returns the immutable CountryObj instance for the country code represented by the specified countryObj parameter.

Returns:

An immutable CountryObj instance.

VB.NET Example:

 

dim chObj as CountryObj = CountryObj.GetCountry()

dim regObj as RegionObj = RegionObj.GetRegion(chObj)

Response.Write("Region code for your region is " + regObj.RegionCode)

C# Example:

 

CountryObj chObj = CountryObj.GetCountry();

RegionObj regObj = RegionObj.GetRegion(chObj);

Response.Write("Region code for your region is " + regObj.RegionCode);

Note: See the ch_basics_vb.aspx sample for more information.