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". 回答1: You can store a hash table. The entries will have as key the country name and as value the continent name. Just generate this table from some public database and once you have it you can simply query it. It's also pretty fast. http://www.geonames.org/countries/ You can get from there a database (there is an option to