我想添加自定义文化,我添加了以下代码但是我收到以下错误:
“找不到类型或命名空间CultureAndRegionInfoBuilder,是否缺少指令或程序集引用”
虽然我使用System.Globalization
并添加了sysglobal.dll
。
string culture = "en-JO";
string name = "Jordan English";
CultureInfo cultureInfo = new CultureInfo("en-GB");
RegionInfo regionInfo = new RegionInfo(cultureInfo.Name);
CultureAndRegionInfoBuilder cultureAndRegionInfoBuilder =
new CultureAndRegionInfoBuilder(culture, CultureAndRegionModifiers.None);
cultureAndRegionInfoBuilder.LoadDataFromCultureInfo(cultureInfo);
cultureAndRegionInfoBuilder.LoadDataFromRegionInfo(regionInfo);
cultureAndRegionInfoBuilder.CultureEnglishName = name;
cultureAndRegionInfoBuilder.CultureNativeName = name;
cultureAndRegionInfoBuilder.Register();