获得国家code。与设备IP地址的帮助 [英] Getting country code with the help of device IP address

查看:143
本文介绍了获得国家code。与设备IP地址的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作有登记过程中的应用,我的要求是:

I am working on an app that have registration process and my requirements are:

要求:


  1. 自动选择国家code与设备IP地址跟踪的帮助。

  2. 注册时检测用户位置并保存。

我搜索了一下,但没找到,这将导致一个答案任何有用的信息,必须有办法,但是那是什么?请让我指导的方式

I searched a bit but did not find any useful information that would lead to an answer, there must be way but what is that? Please let me guide to the way

推荐答案

如果您在注册时从用户地址作为输入,你可以找到从地理坐标地址。更多信息见 https://developers.google.com/maps/documentation/geocoding/ #Geocoding

If you address from user as an input during registration, you can find geo coordinates from address. Fore more information see https://developers.google.com/maps/documentation/geocoding/#Geocoding

对于从IP地址的国家code,你还可以利用类似的在线服务
http://www.whois.net/ip-address-lookup/ 和解析响应检索国家code。 <一href=\"http://stackoverflow.com/questions/5741347/how-to-get-country-$c$c-and-currency-$c$c-by-ip-address\">Here是你如何分析它(code是在PHP,但你可以很容易地修改吧)

Regarding country code from IP address, you can also utilize an online service like http://www.whois.net/ip-address-lookup/ and parse the response to retrieve the country code. Here is how you can parse it (the code is in PHP but you can easily modify it)

这篇关于获得国家code。与设备IP地址的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆