Geolocating IP Address in C#

为君一笑 提交于 2019-12-22 18:06:26

问题


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!


回答1:


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

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

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");
}



回答2:


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. Download it, look at it, I'm sure it's helpful.



来源:https://stackoverflow.com/questions/14959305/geolocating-ip-address-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!