Link to home
Start Free TrialLog in
Avatar of solution1368
solution1368

asked on

IP and Zip Code on asp/mvc app

Two helps from experts.

1. Assume I have a website, and I want to capture the IP from the user.
2. Once the IP is obtained, I want to convert to zip code.

I need some helps how to get both working on MVC 3 asp app.

Thanks
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You can get the IP address from the SERVER variables.  But an IP address belongs to the ISP, not the individual.  Even if you can convert it, the zip code will be that of the ISP, not the individual.
Avatar of solution1368
solution1368

ASKER

That is ok. I still want it.
For the IP address, you get it from the server variables.  Look for 'remote_address' on this page: http://www.w3schools.com/asp/coll_servervariables.asp

I use MaxMind's free GeoIP services.  http://www.maxmind.com/en/geolocation_landing  I use the PHP version but there is an ASP.NET version on their site also.
Thank You. But I hope to find something for free....
Look harder at that page.  I'm using the free version.
no idea how to get it.
On this page http://dev.maxmind.com/geoip/geoip2/geolite2/ are links for the free databases and the APIs including one for C#.
Thank. But I don't really want to install any databases. Any API i can use without the database installed?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't want to upload those files. A simple service call will be preferable. Thanks
I finally use your idea. It works.
Glad to help.
If you are looking for a service I have checked out Location Data.  I think they will meet your needs.  I think they are at locationdata.com