find a website vistor location

K

Karl

Hi,

I wonder if anyone could explain some options for getting the location
of a visitor of a website?

For instance if someone from the UK visit a website designed for US
citizens, how do I find out where the user is and redirect or notify
the user of an alternate site?
 
A

Alexey Smirnov

Hi,

I wonder if anyone could explain some options for getting the location
of a visitor of a website?

For instance if someone from the UK visit a website designed for US
citizens, how do I find out where the user is and redirect or notify
the user of an alternate site?

1) get user IP address
2) lookup the country based on the IP.

To find the user IP address, use
HttpContext.Current.Request.UserHostAddress

To find a country by IP you will need a service, or a database like
www.maxmind.com, www.hostip.info, etc.
 
J

Juan T. Llibre

re:
!> Please try the IP2Location .NET control

IP2Location is so good that it places me in Florida, over 1,400 kilometers
away from where I really am, in another country, even.

It also gives incorrect information about our timezone,
about the ISP my IP addresses and netblock are assigned to,
and even says that we have a US zipcode. All balderdash.

IP2Location has a faulty database which relies on outdated IP ownership data,
instead of relying on routing info. It's very unreliable.

MaxMind, hostip.info and IP-to-Country place me correctly.

See:
http://www.maxmind.com/app/locate_my_ip
http://www.hostip.info/
http://ip-to-country.webhosting.info/




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top