Solved

How to get country, country code and city name by IP address in C#?

Posted on 2009-07-10
5
2,710 Views
Last Modified: 2012-06-27
How to get country, country code and city name by IP address in C#?
0
Comment
Question by:PapaStrumpf
[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
  • 3
5 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24820962
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24820963
You can get the IP Address by - Request.ServerVariables("REMOTE_ADDR")

You can download the Ip-to-country database from: http://ip-to-country.webhosting.info/

and the country information database from: http://www.nabeelakhtar.net/devzone/db_details_index.php?dev=8

SourceForge link to the Country Information Database is: http://sourceforge.net/projects/countrydb/

0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24820965
IPAddressExtensions - extending the System.Net.IPAddress class
http://www.codeplex.com/IPAddressExtensions

Information provided
Country name (eg. Australia)
Country ISO 3166 2-Code (eg. AU)
Country ISO 3166 3-Code (eg. AUS)
Registry. (eg. APNIC)
Date the IP Address (range) was added to the data source (if known).

0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

724 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