Get RegionInfo by country name?

前端 未结 6 1640
一个人的身影
一个人的身影 2020-12-18 22:52

I want to be able to get RegionInfo by doing the following:

new RegionInfo(\"United Kingdom\");

but this throws an exception a

6条回答
  •  情话喂你
    2020-12-18 23:45

    From MSDN;

    A string that contains a two-letter code defined in ISO 3166 for country/region.

    UNITED KINGDOM looks ok on Country names and code elements on the ISO website.

    GB UNITED KINGDOM

    Try with;

    new RegionInfo("GB");
    

提交回复
热议问题