Solved

IP and Zip Code on asp/mvc app

Posted on 2013-10-25
14
592 Views
Last Modified: 2014-03-19
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
Comment
Question by:solution1368
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39602137
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
 

Author Comment

by:solution1368
ID: 39602152
That is ok. I still want it.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39602246
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
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

Author Comment

by:solution1368
ID: 39602973
Thank You. But I hope to find something for free....
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39602995
Look harder at that page.  I'm using the free version.
0
 

Author Comment

by:solution1368
ID: 39603116
no idea how to get it.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39603118
On this page http://dev.maxmind.com/geoip/geoip2/geolite2/ are links for the free databases and the APIs including one for C#.
0
 

Author Comment

by:solution1368
ID: 39603408
Thank. But I don't really want to install any databases. Any API i can use without the database installed?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39603426
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
 

Author Comment

by:solution1368
ID: 39613176
I don't want to upload those files. A simple service call will be preferable. Thanks
0
 

Author Closing Comment

by:solution1368
ID: 39634639
I finally use your idea. It works.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39634753
Glad to help.
0
 

Expert Comment

by:brianregal
ID: 39940549
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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question