来自 IP 地址的经度和纬度值

4

本文介绍了来自 IP 地址的经度和纬度值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

是否可以从asp.net中的IP地址获取经度和纬度值?如果可能的话,请告诉我如何获得这个.

Is it possible to get the longitude and latitude value from IP address in asp.net? If it is possible, please let me know how can I get this.

推荐答案

MaxMind Geolite city免费.如果它不够好,您显然可以升级到更准确的付费版本.我无法评价付费版本的质量,因为我从未使用过它.

MaxMind Geolite city is free. If it is not good enough, you can apparently upgrade to a more accurate paid-version. I can't speak for the quality of the paid version, as I have never used it.

如果您喜欢您的 SQL,请下载 CSV 版本.将其加载到您选择的数据库中,然后查询.

If you like your SQL, download the CSV version. Load it into your database of choice, and query away.

更快、更节省空间的选择是下载文件二进制blob版本同一个数据库,然后使用C#类查询.

The faster and space-efficient option is to download the file binary blob version of the same database, and then use the C# class to query it.

另外,我发现 ipinfodb.com 很有用.查询是通过简单的 HTTP GET.例如,要对 stackoverflow.com 进行地理定位,请尝试:

Alternatively, I have found ipinfodb.com to be useful. Query is by simple HTTP GET. For example, to geolocate stackoverflow.com try:

http://ipinfodb.com/ip_query.php?timezone=false&ip=69.59.196.211

这将返回一个包含纬度和经度的 XML 文件,如下所示:

This will return an XML file containing latitude and longitude, that looks like:

<Response>
  <Ip>69.59.196.211</Ip>
  <Status>OK</Status>
  <CountryCode>US</CountryCode>
  <CountryName>United States</CountryName>
  <RegionCode>41</RegionCode>
  <RegionName>Oregon</RegionName>
  <City>Corvallis</City>
  <ZipPostalCode>97333</ZipPostalCode>
  <Latitude>44.4698</Latitude>
  <Longitude>-123.343</Longitude>
</Response>

http://forum.ipinfodb.com/上提供了一些 VB.NET 示例代码viewtopic.php?f=7&t=269

这篇关于来自 IP 地址的经度和纬度值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Func&lt;string,string&gt; 有什么区别?和委托?
What is the difference between Funclt;string,stringgt; and delegate?(Funclt;string,stringgt; 有什么区别?和委托?)...
2023-11-11 C#/.NET开发问题
3

ASP.NET MVC 中的 &lt;%: 和 &lt;%= 有什么区别?
What is the difference between lt;%: and lt;%= in ASP.NET MVC?(ASP.NET MVC 中的 lt;%: 和 lt;%= 有什么区别?)...
2023-11-10 C#/.NET开发问题
0

标签系统的 linq 查询 - 搜索多个标签
linq query for tag system - search for multiple tags(标签系统的 linq 查询 - 搜索多个标签)...
2023-11-10 C#/.NET开发问题
0

论坛标签.实施它们的最佳方法是什么?
Forum tags. What is the best way to implement them?(论坛标签.实施它们的最佳方法是什么?)...
2023-11-10 C#/.NET开发问题
1

html 脚本标签未使用类型 javascript &lt;script type=&quot;text
html script tag not using type javascript lt;script type=quot;text/htmlquot;gt;?(html 脚本标签未使用类型 javascript lt;script type=quot;text/htmlgt;gt;?)...
2023-11-10 C#/.NET开发问题
6

ASP.NET 控件到 HTML 标记等效
ASP.NET Control to HTML tag equivalent(ASP.NET 控件到 HTML 标记等效)...
2023-11-10 C#/.NET开发问题
32