Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

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
0
solution1368
Asked:
solution1368
  • 7
  • 6
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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.
0
 
solution1368Author Commented:
That is ok. I still want it.
0
 
Dave BaldwinFixer of ProblemsCommented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
solution1368Author Commented:
Thank You. But I hope to find something for free....
0
 
Dave BaldwinFixer of ProblemsCommented:
Look harder at that page.  I'm using the free version.
0
 
solution1368Author Commented:
no idea how to get it.
0
 
Dave BaldwinFixer of ProblemsCommented:
On this page http://dev.maxmind.com/geoip/geoip2/geolite2/ are links for the free databases and the APIs including one for C#.
0
 
solution1368Author Commented:
Thank. But I don't really want to install any databases. Any API i can use without the database installed?
0
 
Dave BaldwinFixer of ProblemsCommented:
All you have to do is upload it.  It is a stand-alone file, not something that goes in an SQL server.  I doubt that there is anything simpler since there is a lot of information to look thru.  The API code reads the info from that database file.
0
 
solution1368Author Commented:
I don't want to upload those files. A simple service call will be preferable. Thanks
0
 
solution1368Author Commented:
I finally use your idea. It works.
0
 
Dave BaldwinFixer of ProblemsCommented:
Glad to help.
0
 
solution1368Author Commented:
0
 
brianregalCommented:
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
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now