?
Solved

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

Posted on 2009-07-10
5
Medium Priority
?
2,775 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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 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