Solved

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

Posted on 2009-07-10
5
2,545 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
  • 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
 
LVL 3

Expert Comment

by:coagantus
ID: 24820966
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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