@shivalthakur and @nilsan : Thanks. But http://freegeoip.net/ gives locn as New Delhi where as i am in Maharashtra.
I also search more than 10 sites for same out of which many gives Bangalore.
Only http://whatismyipaddress.com/ gives me correct locn.
Whats the reason behind it?
http://freegeoip.net/ uses database from IPInfoDB which is mentioned in second link of that article you're referrring.
It seems http://freegeoip.net/ has not updated their db for long, that's why it is not showing correct information. But if you use
IPInfoDB directly it gives you the correct location. Go for it.
UmeshAnil
Member
20 Points
31 Posts
Getting Location from IP Address
May 14, 2012 04:59 AM|LINK
How to get visitors Location from IP Address. Give me simple solution.
For getting IP Address, i used Request.UserHostAddress in Global.asax file.
For getting Locn i refer http://www.aspsnippets.com/Articles/Find-Visitors-Geographic-Location-using-IP-Address-in-ASP.Net.aspx link. but not working
Thanks in Advance.
santosh.jagd...
Star
7625 Points
1454 Posts
Re: Getting Location from IP Address
May 14, 2012 05:03 AM|LINK
hi umesh,
this is common requirement, you may need to free web service that will return you location based on IP address.
here are some examples..
http://www.aspsnippets.com/Articles/Find-Visitors-Geographic-Location-using-IP-Address-in-ASP.Net.aspx
http://www.hostip.info/use.html
MCP
shivalthakur
Participant
1837 Points
531 Posts
Re: Getting Location from IP Address
May 14, 2012 05:06 AM|LINK
last week i was looking for the
Location from IP Address
then i also used the same link doesnot work for me either. then after googling i got this web service and replaced in the code from aspsnippets.com.
WebRequest rssReq = WebRequest.Create("http://freegeoip.net/xml/" + ipaddress);hope will help you
Response.Write("Success");
Best Of Luck
Shival Thakur
narasappa
Participant
960 Points
458 Posts
Re: Getting Location from IP Address
May 14, 2012 05:08 AM|LINK
pls go through below link
http://www.dotnetcurry.com/ShowArticle.aspx?ID=325
ravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
Thanku
nilsan
All-Star
16826 Points
3684 Posts
Re: Getting Location from IP Address
May 14, 2012 05:15 AM|LINK
If you check that article, there're two site links which provide location based on IP.
http://freegeoip.appspot.com/xml/122.169.8.137
This is not working as it has been moved to new domain :
http://freegeoip.net/
Just replace the http://freegeoip.appspot.com with http://freegeoip.net/ and everything else remains the same.
Please check out http://freegeoip.net/ for more info.
UmeshAnil
Member
20 Points
31 Posts
Re: Getting Location from IP Address
May 14, 2012 05:21 AM|LINK
@shivalthakur and @nilsan : Thanks. But http://freegeoip.net/ gives locn as New Delhi where as i am in Maharashtra.
I also search more than 10 sites for same out of which many gives Bangalore.
Only http://whatismyipaddress.com/ gives me correct locn.
Whats the reason behind it?
nilsan
All-Star
16826 Points
3684 Posts
Re: Getting Location from IP Address
May 14, 2012 06:06 AM|LINK
http://freegeoip.net/ uses database from IPInfoDB which is mentioned in second link of that article you're referrring.
It seems http://freegeoip.net/ has not updated their db for long, that's why it is not showing correct information. But if you use IPInfoDB directly it gives you the correct location. Go for it.