問題描述
所以,我在上一個問題中被告知我可以使用 MaxMind 提供的 數(shù)據(jù)庫來確定位置.
So, I was told in my previous question that I can use the databases provided by MaxMind to determine locations.
所以,我從他們的網(wǎng)站下載了他們的數(shù)據(jù)庫.它們是 csv
文件并在 Excel 中打開.
So, I got their databases downloaded from their site. They are csv
files and open up in Excel.
InetAddress ip = InetAddress.getLocalHost()
是我獲取計算機 IP 的方式.從那里我做 String justIP = ip.getHostAddress()
InetAddress ip = InetAddress.getLocalHost()
is how I get the IP of my computer. From there I do String justIP = ip.getHostAddress()
我的問題是:
justIP
解析為城市位置???我對此很陌生,因此將不勝感激.
My question is:
justIP
to a city location using the DB I just downloaded ??? I am new to this so a little help will be appreciated.
其中一個文件包含三列.startIPNum
、endIPNum
和 locID
我不知道這些是做什么的,但我猜 locID
映射到一個城市和國家在另一個文件中的位置.
One of the files has three columns. startIPNum
, endIPNum
and locID
I do not know what these do but I guess locID
maps to a city and country location in the other file.
推薦答案
你試過 Maxmind 的 Java 例子嗎?http://dev.maxmind.com/geoip/downloadable#Java-8
有關字段說明,請參見 http://dev.maxmind.com/geoip/csv
Did you tried the Java examples from Maxmind? http://dev.maxmind.com/geoip/downloadable#Java-8
And see http://dev.maxmind.com/geoip/csv for field descriptions
這篇關于如何使用 MaxMind 的 GeoIP 數(shù)據(jù)庫來確定位置?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!