.NET RegionInfo class

后端 未结 2 489
有刺的猬
有刺的猬 2021-02-08 10:16

When I try to create a new RegionInfo with certain ISO 3166 country codes (\"BD\" for Bangladesh, \"SO\" for Somalia, \"LK\" for Sri Lanka), I get an ArgumentException that says

2条回答
  •  感情败类
    2021-02-08 10:52

    .NET doesn't provide all Cultures/Regions out-of-the-box. Note the 'predefined' RegionInfos here: http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo(VS.80).aspx.

    Unfortunately, if you want to use non-predefined Regions, you have to define them yourself. Here's the MSDN how-to: http://msdn.microsoft.com/en-us/library/ms172469(VS.80).aspx.

提交回复
热议问题