如何从IP地址知道地理位置 [英] How to know Geographic location from an IP address
问题描述
我已经在我的Web项目中的jsp / servlet中创建了一个登录应用程序,并且想了解访问我的登录页面的不同用户的地理位置。我怎么知道一个人正在从哪里访问我的登录页面?例如:如果一个人从加拿大访问一个页面,那么记录将被插入到我的数据库中,例如:IP:20.4.9.134和位置:加拿大。
I have created a login application in jsp/servlet in my web project and I want to know about the geographic locations of different users those access my login page. How can I know that a person is accessing my login page from where? For example: If a person is accessing a page from Canada then a record will be inserted into my database such as : IP: 20.4.9.134 and location: Canada.
任何帮助是赞赏。
推荐答案
我使用这个:
http://freegeoip.net/xml/122.169.8.137
或
http://www.geoplugin.net/xml.gp?ip=xx.xx.xx.xx
轻松通话,它会让你一个xml与您需要知道的一切
Easy call and it throws you an xml with everything you need to know
编辑:地理位置的新位置
New location for geoip
这篇关于如何从IP地址知道地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!