![]() ![]() IP2LOCATION INSTALLThen inside the Visual Studio, install the following IP2Location NuGet package.Īs per the model-view-controller (MVC) style of doing things, we will have 3 files. If you don’t have one, you can create it. Extract that file and save it somewhere, e.g. Inside the downloaded zipped file, you will find a BIN file. If you are unfamiliar with MVC, you can go through some of the videos at the link below:įirst of all, you will need to subscribe to the DB25 database at and then download the DB25 BIN database file. Our example will be a simple form which will submit an IP address to be queried for IP geolocation data. We will assume that you already know the basics of ASP.NET MVC so we will just show the relevant codes using C#. NET component within an ASP.NET MVC 5 project. IP2LOCATION HOW TOcountry_groupings addon for i, s := range res.For this article, we will look into how to integrate the IP2Location. Printf( "Geotargeting => Metro: %s \n", res. Printf( "Country => Language => Name: %s \n", res. Printf( "Country => Language => Code: %s \n", res. Printf( "Country => Currency => Symbol: %s \n", res. Printf( "Country => Currency => Name: %s \n", res. Printf( "Country => Currency => Code: %s \n", res. Printf( "Country => IddCode: %s \n", res. Printf( "Country => Population: %s \n", res. ![]() Printf( "Country => TotalArea: %s \n", res. Printf( "Country => Capital: %s \n", res. ![]() Printf( "Country => Demonym: %s \n", res. Printf( "Country => NumericCode: %s \n", res. Printf( "Country => Alpha3Code: %s \n", res. Printf( "Continent => Hemisphere: % v \n", res. Printf( "WeatherStationName: %s \n", res. Printf( "WeatherStationCode: %s \n", res. ![]() "/ip2location/ip2location-go/v9" "fmt"Īpikey := "YOUR_API_KEY" apipackage := "WS25" usessl := true addon := "continent,country,region,city,geotargeting,country_groupings,time_zone_info" // leave blank if no need lang := "en" // leave blank if no need ws, err := ip2location. This method returns the web service credit balance in an object. This method returns an object containing the geolocation info. } QUERY USING THE IP2LOCATION WEB SERVICE Methods Printf( "api version: %s \n", ip2location. Printf( "weatherstationname: %s \n", results. Printf( "weatherstationcode: %s \n", results. OpenDB( "./IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY.BIN") "fmt" "/ip2location/ip2location-go/v9"ĭb, err := ip2location. Returns the geolocation information in an object. Initialize the package with the BIN file. Methodsīelow are the methods supported in this package. Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses. Use the IPv4 BIN file if you just need to query IPv4 addresses.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |