CountryName Property (.NET)

The CountryName property returns the descriptive name for which the particular instance of the CountryObj class contains data for.

Tip: You can change the values that are returned by the CountryName property by editing your countrynames.properties file. For example, you could change "Macedonia, Former Yugoslav Republic" to just " Macedonia". Likewise you could also translate all the country names into the language of your choice.

Note: This property is only supported in the Professional and Enterprise Editions of CountryHawk.

Syntax:

 countryNameAsStr = chObj.CountryName

Returns:

String representing the descriptive name for which the particular instance of the CountryObj class contains data for. For example, "United States" and " Canada". These two-letter country codes are defined in your countrynames.properties file.

VB.NET Example:

dim chObj as CountryObj = CountryObj.GetCountry()

Response.Write("Your country name is: " + chObj.CountryName)

chObj = CountryObj.GetCountry("207.46.230.220")

Response.Write("<br>Country name for 207.46.230.220 is: " + chObj.CountryName)

chObj = CountryObj.GetCountry("FR")

Response.Write("<br>Country name for country code FR: " + chObj.CountryName)

C# Example:

CountryObj chObj = CountryObj.GetCountry();

Response.Write("Your country name is: " + chObj.CountryName);

chObj = CountryObj.GetCountry("207.46.230.220");

Response.Write("<br>Country name for 207.46.230.220 is: " + chObj.CountryName);

chObj = CountryObj.GetCountry("FR");

Response.Write("<br>Country name for country code FR: " + chObj.CountryName);

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

Note: This property is read-only.