Fog Creek Software
g
Discussion Board




Populating Country List Boxes

In a thread discussed earlier, http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=79339&ixReplies=66 ,  Tony asked how sites identify the country you're from... I didn't see a satisfactory reply, so I did a bit of research and found this cool little country list box populater written for ASP.NET by Paul Ingles on codeproject:

http://www.codeproject.com/aspnet/countrylistbox.asp

The cool thing about it is that it looks up your IP in a database from MaxMind (GeoIP Free Database) and determines the country you're in, then defaults to that country.

nathan
Sunday, October 26, 2003

Why do I have the feeling there is a Perl module to do this as of 3 years ago?

Hatty
Sunday, October 26, 2003

You could lookup against zz.countries.nerd.dk. It's a standard DNS query, no special GeoIP API required. Easy to do from C#.

(It'd be even easier if System.Net.Dns supported TXT queries.)

Nate Silva
Monday, October 27, 2003

*  Recent Topics

*  Fog Creek Home