问题
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