Geolocating IP Address in C#

2019-05-22 02:09发布

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!

2条回答
▲ chillily
2楼-- · 2019-05-22 02:33

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.

查看更多
smile是对你的礼貌
3楼-- · 2019-05-22 02:56

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");
}
查看更多
登录 后发表回答