Using CountryWhois SDK
The SDK includes swapimap.dll that includes the IP-to-country database and exports a set of functions that allows you to utilize this database in your application. The SDK functions fall into the following four categories (see the corresponding section of this document for the function list and usage examples):
Functions for Obtaining the Country ID Functions for Obtaining Information About a Country Functions for Obtaining the Continent ID Functions for Obtaining Information About a Continent
You can start using CountryWhois SDK as easy as 1-2-3:
- Get the country ID by IP address using the SWAPI_IPAddressToCountryID or SWAPI_IPStringToCountryID functions.
- Once you have obtained the ID, get the country name or ISO 3166-1 code using the SWAPI_CountryIDToCountryCode or SWAPI_CountryIDToCountryName functions.
- You're done. You've determined the country by IP address.
It's important to understand that IP address allocation is constantly changing. Every day, new IP addresses are assigned or re-allocated. As time passes, the accuracy of the database rapidly declines, so in a few months a substantial percentage of IP addresses will be incorrectly identified unless you regularly download the latest swapimap.dll. The latest, regularly updated swapimap.dll is available in the CountryWhois DB Subscriber's Area.
Copyright © 2006-2008, TamoSoft
|