我的程序内容: 先在Console Application里创建一个Custom Culture “hk” , 然后在xmal.cs里使用Custom Culture ‘hk’
该程序都是以Administrator身份运行,在Win7,Win2008下正常使用。 可是到了xp下,会抛出exception “Culture name 'hk' is not supported. Parameter name:name”. 上网查了很多资料都没有找到合理的解释。
请问这是什么原因? 谢谢。
程序相关代码:
// 创建Custom Culture "hk"
ConsoleApplication :
class Program
{
static void Main(string[] args)
{
CultureAndRegionInfoBuilder cib = new CultureAndRegionInfoBuilder("hk", CultureAndRegionModifiers.None);
CultureInfo ci = new CultureInfo("en-US");
cib.LoadDataFromCultureInfo(ci);
RegionInfo ri = new RegionInfo("US");
cib.LoadDataFromRegionInfo(ri);
cib.Register();
}
}
//使用Custom Culture ‘hk’
SilverlightApplication:
public MainPage()
{
InitializeComponent();
CultureInfo info = new CultureInfo("hk"); // It will throw exception in xp. "Culture name 'hk' is not supported. Parameter name:name"
Thread.CurrentThread.CurrentCulture = info;
Thread.CurrentThread.CurrentUICulture = info;
}