在C#中定位IP地址 [英] Geolocating IP Address in C#

查看:405
本文介绍了在C#中定位IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#开发Windows 8应用程序 并想要获取IP地址的地理坐标 或者 想要一个可以在Windows 8应用程序中准确或几乎地理定位IP地址的API! 预先感谢您的帮助!

I am developing an windows 8 app in C# And want to get Geo Coordinates of IP addresses or Want an API that can exactly or nearly geolocate the IP address in windows 8 app! Thanks in advance for your help!

推荐答案

在这里使用Web服务每小时免费10000个请求

Just use a web service here is free one 10000 requests per hour

http://freegeoip.net/static/index.html

REST调用 http://freegeoip.net/xml/[您的IP]

编辑

从网址下载的简单代码

using (var objClient = new System.Net.WebClient())
{
    var strFile = objClient.DownloadString("http://freegeoip.net/xml/192.168.0.1");
}

这篇关于在C#中定位IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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