Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a country's continent in C#

Is there a way to find a country's continent in C#, using the RegionInfo class or any other way?

For example, you give the country name "Denmark" and it returns "Europe".

like image 584
Mark Sillatson Avatar asked Mar 27 '11 15:03

Mark Sillatson


1 Answers

Nothing like that in the .NET framework. It is also rather ambiguous with geographical definitions for Eurasia and Oceania. There are 6 distinct definitions in use. You'll need your own dbase.

like image 198
Hans Passant Avatar answered Oct 05 '22 18:10

Hans Passant