Get Location from IP Adress in c#
How to get the proper location of the client from IP Address using asp.net C# ???
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sunny SharmaRank #223 · 11.1K reputationPosted Sep 28, 2013, 2:45 AM EDT
Use any web service that offers IP to GeoLocation reverse-address-lookup.
There are many companies out there offering the same. For example I'm using one of the below:
http://ip-api.com/json/173.194.36.82
You just need to make a web request and read the response. For above example request it will produce an xml response like:
-------------------------------------
{"status":"success","country":"United States","countryCode":"US","region":"CA","regionName":"California","city":"Mountain View","zip":"94043","lat":"37.4192","lon":"-122.0574","timezone":"America\/Los_Angeles","isp":"Google","org":"Google","as":"AS15169 Google Inc.","query":"173.194.36.82"}So, now you can easily parse this json and utilize as you want.
Hope it helps :)