简体   繁体   中英

How can I tell a location of website being viewed?

How can I access some of the Geo encoding for a website I am making?

I would like to extract the location information of where the site is being viewed/used at. This would allow the check-in process to go more smoothly when the users do.

Any suggestions for VB.NET in Visual Studio 2008?

Thanks

I would suggest simply using Google Analytics . It's free and quite robust.

They geocode all requests to your site, so you can see it on a map and what not.

在此输入图像描述

If you want to do it under your own control the process is often referred to as geo-ip. There are several ways to get this data and I don't have enough personal experience with one to suggest a particular vendor.

https://www.google.com/search?q=geo-ip

if you want to get really low level you look up the client ip whois record and see who owns the ip and their contact address. That seems to be what most of those mentioned in the google search are doing anyway.

I have used some of the free lookup databases from behind asp.net but I usually did all the heavy lifting in sql sprocs and just dumped the result to the front end as I had more sql horsepower at the time than webserver.

Free geo ip is a free web service that will give you all the information you need.

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

You make a call to the service

http://freegeoip.net/{format}/{ip_or_hostname}

And the service returns in a JSON format:

show({"city": "Mountain View", "region_code": "CA", "region_name": "California", "metrocode": "807", "zipcode": "94043", "longitude": "-122.057", "country_name": "United States", "country_code": "US", "ip": "209.85.145.147", "latitude": "37.4192"});

Since it is free you can only process 1000 requests per hour.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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