我在我的 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
geoip 的新位置
这篇关于如何从 IP 地址获知地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)