.netCOUNTRY Generator

Navigation: »No topics above this level«

.netCOUNTRY Generator

 Return to chapter overview

Please feel free to navigate this help document for information on installation, developer documentation, reference, samples, support and licensing.


Overview

Overview of .netCOUNTRY

Navigation: .netCOUNTRY Generator >

Overview of .netCOUNTRY

 Return to chapter overview

.netCOUNTRY provides location, language and culture analysis in real-time for your ASP.NET web site. Locate visitors and convert their IP and browser details to country code, country name, language code, language name, culture code, currency and more!

Product Features:

· IP to Country Code Lookups
· IP to Country Name Lookups
· IP to Culture Lookups
· IP to Language Lookups
· IP to Language Code Lookups
· IP to Flag (as an image) Lookups
· IP to Currency Lookups
· IP to HostName return *NEW
· IP Check Blacklist *NEW
· Country Code to Country Name Conversion
· Country Code to Culture Conversion
· Country Code to Language Conversion
· Country Code to Language Code Conversion
· Country Code to Flag Conversion
· Country Code to Currency Conversion
· Country Name to Country Code Conversion
· Culture to Country Code Conversion
· Flag to Country Code conversion
· Browser to Country Code Lookups
· Browser to Country Name Lookups
· Browser to Culture Lookups
· Browser to Language Name Lookups
· Browser to Language Code Lookups
· Browser to Flag Lookups
· Browser to Currency Lookups
· Control default return cases
· Methods automatically obtain client IP / browser details
· IP / Browser details can also be specified with an optional parameter or a dedicated property
· Database Accuracy Enhanced and updated from multiple sources *NEW
· New update system (no subscription required) automatically keeps the database up to date *NEW
· IPToWhois realtime whois lookup method *NEW

Learn more about .netCOUNTRY and play with a live demo at our web site.


Version History

Navigation: .netCOUNTRY Generator >

Version History

 Return to chapter overview

Version 3.0 March 2015

· New phone number lookup (PhoneToCode)
· Relational database support (MS Access, Sql Server, MySql, Oracle)
· Updated database

Version 2.1 August 2007

· New realtime whois lookup (IPToWhois)
· Updated database

Version 2.0: May 2007

· Real-time reverse DNS lookups (IPToHostname)
· Real-time SORBS blacklist lookups (IPCheckBlacklist)
· Updated country database with enhanced accuracy
· New automated update system (no subscription required)

Version 1.0: Initial Release

· See overview for a complete features list.


Installation

Navigation: »No topics above this level«

Installation

 Return to chapter overview

System Requirements provides information on the minimum requirements for running .netCOUNTRY.

Instructions provides information on how to install .netCOUNTRY.


System Requirements

Navigation: Installation >

System Requirements

 Return to chapter overview

.netCOUNTRY is designed to be used in a web server environment with ASP.NET.

Supported Operating System:

· Windows Server2000/2008/2012 Server

Additional Requirements:

· ASP.NET 2.0 or later

Note: .netCOUNTRY supports shared hosting environments even in medium trust!


Instructions

Navigation: Installation >

Instructions

 Return to chapter overview

.netCOUNTRY can be deployed quickly and easily without any special installation or registration requirements. It will work with a dedicated server, shared server, hosted server etc. so long as the server supports ASP.NET - as soon as you copy your files to your web server you can start using .netCOUNTRY!

Procedure:

· Unzip distribution
· Copy / FTP web files to a directory of your choice within your web servers root directory
· Ensure that dotnetcountry.dll and your purchase key are located in the /bin directory and that the /bin directory is in the root (top level) of your web site or, if not, that you have created an application for the subdirectory which contains your /bin directory.
· You may now use the .netCOUNTRY samples through http://localhost for development or the domain you are licensed for in production.

Using a Virtual Directory:

· Unzip distribution
· Place files in any directory you wish
· Using the IIS administration (MMC), create a virtual directory under your web site pointing to the /web directory that contains the .netCOUNTRY samples. Click here for more information on virtual directory creation.
· Ensure that your purchase key is located in the /bin directory along with dotnetcountry.dll
· You may now use the .netCOUNTRY samples through http://localhost for development or the domain you are licensed for in production.


Developer Documentation

Navigation: »No topics above this level«

Developer Documentation

 Return to chapter overview

This topic includes a complete reference included with .netCOUNTRY as well as some examples.


Reference

Navigation: Developer Documentation >

Reference

 Return to chapter overview

Detailed guide to .netCOUNTRY methods and properties.


Methods

Navigation: Developer Documentation > Reference >

Methods

 Return to chapter overview

IPToCode( ): This method returns the country code from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToCode

Result = Country.IPToCode("255.255.255.255")

IPToName( ): This method returns the country name from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToName

Result = Country.IPToName("255.255.255.255")

IPToCulture( ): This method returns the culture from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToCulture

Result = Country.IPToCulture("255.255.255.255")

IPToLanguage( ): This method returns the language from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToLanguage

Result = Country.IPToLanguage("255.255.255.255")

IPToLanguageCode( ): This method returns the language code from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToLanguageCode

Result = Country.IPToLanguageCode("255.255.255.255")

IPToFlag( ): This method returns the flag image name from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToFlag

Result = Country.IPToFlag("255.255.255.255")

IPToCurrency( ): This method returns the currency code from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToCurrency

Result = Country.IPToCurrency("255.255.255.255")

IPToHostname( ): This method returns the hostname using a realtime DNS lookup from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method.

Result = Country.IPToHostName

Result = Country.IPToHostName("255.255.255.255")

IPCheckBlacklist( ): This method returns true or false if the IP is in the SORBS blacklist database from a real-time lookup. This list includes many anonymous proxies and systems used by spammers from the users IP which is automatically obtained. Optionally the IP property could be set in which case that specific IP would be used or the IP could be provided as an optional string parameter to this method. Since this does a realtime lookup it should be avoided where page request time is important.

Result = Country.IPToHostName

Result = Country.IPToHostName("255.255.255.255")

IPToWhois( ): This method returns a string of the complete real-time whois information for a given IP including the owner of the IP, country and contact details. Typically IP's are owned by ISP or network providers not individual companies but some larger companies own IP blocks. Since this does a realtime lookup it should be avoided where page request time is important.

Result = Country.IPToWhois

Result = Country.IPToWhois("255.255.255.255")

BrowserToCode( ): This method returns the country code from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToCode

Result = Country.BrowserToCode("en-US")

BrowserToName( ): This method returns the country name from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToName

Result = Country.BrowserToName("en-US")

BrowserToCulture( ): This method returns the culture from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToCulture

Result = Country.BrowserToCulture("en-US")

BrowserToLanguage( ): This method returns the language from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToLanguage

Result = Country.BrowserToLanguage("en-US")

BrowserToLanguageCode( ): This method returns the language code from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToLanguageCode

Result = Country.BrowserToLanguageCode("en-US")

BrowserToFlag( ): This method returns the flag image name from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToFlag

Result = Country.BrowserToFlag("en-US")

BrowserToCurrency( ): This method returns the currency code from the users browser settings which are automatically obtained. Optionally the AcceptLanguage property could be set directly in which case that specific string would be used or the string could be provided as an optional parameter to this method.

Result = Country.BrowserToCurrency

Result = Country.BrowserToCurrency("en-US")

CodeToName( ): This method returns a country name when provided with a country code.

Result = Country.CodeToName("US")

CodeToCulture( ): This method returns a culture when provided with a country code.

Result = Country.CodeToCulture("US")

CodeToLanguage( ): This method returns a language name when provided with a country code.

Result = Country.CodeToLanguage("US")

CodeToLanguageCode( ): This method returns a language code when provided with a country code.

Result = Country.CodeToLanguageCode("US")

CodeToFlag( ): This method returns a flag image name when provided with a country code.

Result = Country.CodeToFlag("US")

CodeToCurrency( ): This method returns a currency code when provided with a country code.

Result = Country.CodeToCurrency("US")

NameToCode( ): This method returns a country code when provided with a country name.

Result = Country.NameToCode("US")

CultureToCode( ): This method returns a country code when provided with a culture.

Result = Country.CultureToCode("US")

PhoneToCode( ): This method returns a CountryCode or CountryCode-StateCode for United States and Canada. See Phone.aspx sample
Result = Country.PhoneToCode("703");//returns US-VA

Result = Country.PhoneToCode("1251");//returns US-AL

Result = Country.PhoneToCode("251");//returns ET

LanguageCodeToLanguage( ): This method returns a language name when provided with a language code.

Result = Country.LanguageCodeToLanguage("US")

FlagToCode( ): This method returns a country code when provided with a country flag image name.

Result = Country.FlagToCode("US")

Update( ): This method downloads the latest country.data file and renames the old one to current time span. This method returns a boolean (true/false) on the success of an update.

Relational database support: Version 3 supports MS Access, Sql Server, MySql and Oracle for mapping phone to code and tax rates for all the zip codes in United States and provinces in Canada. For more information see phoneDB.aspx or contact: info@dotnetcountry.com


Properties

Navigation: Developer Documentation > Reference >

Properties

 Return to chapter overview

DBPath: It accepts the DB path as physical path or relative path.

Country.DBPath = "/data"

Country.DBPath = "c:\countrydata"

IP: Accepts the IP address as a string to be used by applicable methods. If this property is set it will be used instead of the automatic detection or optional method parameter.

Country.IP = "255.255.255.255"

AcceptLanguage: Accepts the Accept-Language header as a string to be used by applicable methods. If this property is set it will be used instead of the automatic detection or optional method parameter.

Country.AcceptLanguage = "en-US"

LogPath: It accepts the Log path as physical path or relative path.

Country.LogPath = "/logs"

Country.LogPath = "c:\logs"

DefaultFlag: Contains the return value if any of the IPToFlag, CodeToFlag or BrowserToFlag methods fails to lookup the requested Flag. The default is "UNKNOWN".

Country.DefaultFlag = "us.gif"

DefaultName: Contains the return value if any of the IPToName, CodeToName or BrowserToName methods fails to lookup the requested Name. The default is "UNKNOWN".

Country.DefaultName = "United States"

DefaultCulture: Contains the return value if any of the IPToCulture, CodeToCulture or BrowserToCulture methods fails to lookup the requested Culture. The default is "UNKNOWN".

Country.DefaultCulture = "en-US"

DefaultLanguageCode: Contains the return value if any of the IPToLanguageCode, CodeToLanguageCode or BrowserToLanguageCode methods fails to lookup the requested LanguageCode. The default is "UNKNOWN".

Country.DefaultLanguageCode= "en"

DefaultLanguage: Contains the value if any of the IPToLanguage, CodeToLanguage or BrowserToLanguage methods fails to lookup the requested Language. The default is "UNKNOWN".

Country.DefaultLanguage= "English"

DefaultCode: Contains the value if any of the IPToCode, NameToCode or BrowserToCode methods fails to lookup the requested code. The default is "UNKNOWN".

Country.DefaultCode= "US"


Examples

Navigation: Developer Documentation >

Examples

 Return to chapter overview

.netCOUNTRY is a powerful component that can be used in your ASP.NET pages. Examples can be found in the /web directory in both C# (/csharp) and VB.NET (/vbnet). The following files are included:

Features.aspx: A sample that demonstrates usage for the majority of .netCOUNTRY's features including sample usage for the various methods.

Update.aspx: A sample showing usage for the update system. An update subscription is required to use the update method to regularly obtain new databases.

DropDown.aspx: A sample showing an country drop down list that will automatically select the default country based on the country of the visitor.

Flag.aspx: A sample which will render the flag for the specific country a visitor is from.

FraudCheck.aspx: A fraud check sample that compares input from a form to the country reported for the user from the IP and browser settings and takes different actions based on these values.

Restrict.aspx: Conditionally renders a download link or export restriction message based on the users country.

Phone/PhoneDB.aspx: Demonstrates phone number to country / state / province conversions using the integrated database and relational database (PhoneDB).


Support

Navigation: »No topics above this level«

Support

 Return to chapter overview

Before contacting support be sure to read the frequent questions listings and review the support policy.


Frequent Questions

Navigation: Support >

Frequent Questions

 Return to chapter overview

Can .netCOUNTRY be used in a traditional ASP script?

No, it requires ASP.NET, for more information please see the system requirements.

Is accuracy affected over time with .netCOUNTRY?

By using the automated update system you can ensure that your country detection remains up to date and accurate. .netCOUNTRY uses multiple databases to fill in holes other systems do not cover. In addition, accuracy checks are performed to continue to refine and increase country db accuracy.

What is the difference between browser and IP country returns?

.netCOUNTRY supports a number of methods that examine the browser or IP to make country, language, or culture determination. The browser data is most accurate for language and culture and is based on the users preference. The IP is based on analysis of their network location. For this reason it is easier for the user to spoof or change the browser setting than it is for them to do the same for their IP.

.netCOUNTRY returns an empty value instead of the converted result. Why?

Your trial is expired or license key is not deployed.


Support Policy

Navigation: Support >

Support Policy

 Return to chapter overview

30 days of priority email support is provided with purchase. Upgrades are included free for 90 days.

Support is offered for evaluations / presales on an as available basis.

Priority support contracts can be purchased.


Contacting Support

Navigation: Support >

Contacting Support

 Return to chapter overview

You can contact support by emailing info@dotnetcountry.com

Please be sure to include the following information:

· Your orderid provided when you purchased .netCOUNTRY
· A detailed description of your problem
· An exact error message if applicable
· Specifics of your server environment


Licensing Information

Navigation: »No topics above this level«

Licensing Information

 Return to chapter overview

This chapter includes information on pricing as well as the license agreement.


Pricing & Purchase

Navigation: Licensing Information >

Pricing & Purchase

 Return to chapter overview

.netCOUNTRY is Licensed per site / store:

Single Site: $125 (USD) Usage for a single site / store.

Bonus: We are including a free development license with each license of .netCOUNTRY sold.

When you purchase .netCOUNTRY you are asked to provide your web site address. Your license is bound to this address and allows for the product to work on this site only, for a single store. With each purchase, a free development license is included which allows you to use the product locally for development purposes at no additional charge.


License Agreement

Navigation: Licensing Information >

License Agreement

 Return to chapter overview

This license agreement is a legal agreement between you and Corporate Web Solutions for .netCOUNTRY. By using this product/key you agree to be bound by the terms of this agreement.

This software/key is protected by national and international copyright laws. This software/key is licensed, not sold.

Granted Rights: This license grants you the right to install this software/key for use on a single (1) web site for the domain specified when your key was purchased. In addition, you may use the product for local development purposes on a single (1) computer system. This product/key is licensed per site (also known as per domain). Your license grants you specific rights to use the .netCOUNTRY product and database. These rights are not extended to any third parties.

Limitations: You may not reverse engineer, decompile, or disassemble .netCOUNTRY. You may not rent or lease this software/key, you may not transfer your rights under this license agreement. A license may not be used for any domain other than that specified at the time of purchase, licenses can not be transferred to different domains at any time. .netCOUNTRY is not a traditional development tool and may not be used in any other application outside of a web server environment. .netCOUNTRY may not be integrated with or incorporated into any software product or script sold or offered to any 3rd party. A single .netCOUNTRY license may not be used in an ISP / Mall environment, each site must have its own unique license. .netCOUNTRY functionality may not be exposed or wrapped through a web service or similar system.

Ownership: Corporate Web Solutions retains ownership of the software/key.

Liability: In no event shall Corporate Web Solutions be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of information or any other pecuniary loss) arising out of the use of inability to use this software/key, even if Corporate Web Solutions has been advised of the possibility of such damages.

Termination: Without prejudice to any other rights, Corporate Web Solutions may terminate this license agreement if you fail to comply with the terms and conditions of this agreement. In such event, you must destroy all copies of .netCOUNTRY, any derivative work, and all of its component parts.

General: By installing this software/key you acknowledge that you have read this license agreement, understand it, and agree to be bound by its terms and conditions.


Virtual Directory Creation

Navigation: »No topics above this level«

Virtual Directory Creation

 Return to chapter overview

To create a virtual directory you should complete the following steps:

1) Open the MMC (Microsoft Management Console) also called Internet Services Management or commonly referred to as the IIS administration.

2) You will see a list of snap ins, one of which will be called Internet Information Server. Under this you will see your server name, select this server to view a list of sites running on the server

3) Select the site you wish to add a virtual directory for, right click on this site and select "new", "virtual directory"

4) You will be prompted to enter the alias, this is the name you want to access the content through for example enter "dotnetcountry" and select next

5) You will be promoted to enter the physical path, this is the path where you unpacked .netCOUNTRY, for example "c:\dotnetcountry\web" you want to point to the web directory as this directory contains the web samples

6) Select "next" and "finish" on the final page.

Your virtual directory is now setup, and you can load the samples through http://www.yoursiteaddress.com/dotnetcountry