Get RegionInfo by country name?

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

    Note this comment from the metadata for the parameter name which explains the change from .NET Framework 2.0 on:

        //     A string containing one of the two-letter codes defined in ISO 3166 for country/region.-or-Beginning
        //     in .NET Framework version 2.0, a string containing 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, not just the country/region.
    

提交回复
热议问题