Solved

IP and Zip Code on asp/mvc app

Posted on 2013-10-25
14
575 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
  • 7
  • 6
14 Comments
 
LVL 82

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 82

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
 

Author Comment

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

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 82

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 82

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 82

Expert Comment

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

Author Comment

by:solution1368
ID: 39634906
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now