Get RegionInfo by country name?

前端 未结 6 1645
一个人的身影
一个人的身影 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:26

    If I navigate to the constructor the summary I see in Visual Studio says:

    name: A string that contains a two-letter code defined in ISO 3166 for country/region.-or-A string that contains the culture name for a specific culture, custom culture, or Windows-only culture. If the culture name is not in RFC 4646 format, your application should specify the entire culture name instead of just the country/region.

    The entire culture name would be 'en-GB'.

    Or you could use 'GB'

提交回复
热议问题