简体   繁体   English

在C#中地址定位IP地址

[英]Geolocating IP Address in C#

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! 我正在使用C#开发一个Windows 8应用程序并想要获得IP地址的Geo坐标或想要一个能够在Windows 8应用程序中完全或接近地址定位IP地址的API! Thanks in advance for your help! 在此先感谢您的帮助!

Just use a web service here is free one 10000 requests per hour 这里只需使用一个Web服务就可以免费获得每小时10000个请求

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

REST Call http://freegeoip.net/xml/[your ip] REST Call http://freegeoip.net/xml/ [your ip]

EDIT 编辑

Simple code to download from a url 从网址下载的简单代码

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

If you type your question in any web search engine, this page is bound to come up: Windows 8 Geolocation sample in C#, VB.NET, C++, JavaScript for Visual Studio 2012 . 如果您在任何Web搜索引擎中键入问题,则必然会出现此页面: 用于Visual Studio 2012的C#,VB.NET,C ++,JavaScript中的Windows 8 Geolocation示例 Download it, look at it, I'm sure it's helpful. 下载它,看看它,我相信它是有帮助的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM