有一个问题困扰我好几天了,等大家救火啊!本地化的问题,我现在要在中文模拟器上实现不同的本地语言,英语和汉语。我在资源文件里面写了两种语言的字符串,然后让用户选择语言,代码大致如下:
if (Data.Language == 1)
{
LocRM = new ResourceManager("EHR_Demo.UI.Aboard1", typeof(Aboard1).Assembly);
}
else
{
LocRM = new ResourceManager("EHR_Demo.UI.Aboard1.en", typeof(Aboard1).Assembly);
}
EHR_Demo.UI.Aboard1,EHR_Demo.UI.Aboard1.en,这些都是我在本窗体下的资源文件
然后:
private void Aboard1_Load(object sender, EventArgs e)
{
textBox1.Text = LocRM.GetString("strUser");
}
结果执行到这里的时候,总是报:An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
怎么解决啊?
if (Data.Language == 1)
{
LocRM = new ResourceManager("EHR_Demo.UI.Aboard1", typeof(Aboard1).Assembly);
}
else
{
LocRM = new ResourceManager("EHR_Demo.UI.Aboard1.en", typeof(Aboard1).Assembly);
}
EHR_Demo.UI.Aboard1,EHR_Demo.UI.Aboard1.en,这些都是我在本窗体下的资源文件
然后:
private void Aboard1_Load(object sender, EventArgs e)
{
textBox1.Text = LocRM.GetString("strUser");
}
结果执行到这里的时候,总是报:An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
怎么解决啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货