Free / Open Source
IP2Location IP Geolocation Pascal Library
This IP Geolocation library is a Pascal library to support all IP2Location™ database products. It has been optimized for speed and memory utilization. Developers can use this library to query all IP2Location™ binary databases for applications written in Pascal/Delphi.
Installation
- Download pascal library ip2location-pascal-x.x.x.zip and sample database sample.bin.dbx.zip.
- Unzip the library.
- Run the sample code provided inside the zip file.
Sample Codes
#import <Foundation/Foundation.h> #import <ip2location/IP2Location.h> int main(int argc, const char * argv[]) { @autoreleasepool { //open database IPLocation *locationDB = [[IPLocation alloc] initWithDataPath: @"data/IP-COUNTRY-SAMPLE.BIN"]; //set memory cache type [locationDB setMemoryType: IP2LOCATION_MEMORY_CACHE]; //search IPLocationRecord *rec = [locationDB recordWithIP: @"8.8.8.8"]; NSLog(@"%@", rec.countryShort); } return 0; }
Sample IP2Location Databases (BIN)