刚学做wince 这两天在弄多语言
我是用资源文件做的
ResourceManager rm = new ResourceManager("TextOne", Assembly.GetCallingAssembly());
string day;
string year;
string months; CultureInfo ci = new CultureInfo("zh-CN");
day = rm.GetString("day", ci); ☜ 这里报错
year = rm.GetString("year", ci);
months = rm.GetString("holiday", ci);
这些代码我是参考
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.chs/fxref_mscorlib/html/3ad9deea-8616-27cd-8364-3313fd47d111.htm
写的
只是在资源文件方面我是自己手动创建的,
TextOne\bin\Debug\zh-CN 和TextOne\bin\Debug\es-ES目录下分别生成了TextOne.resources.dll文件 在报错位置(↑)提示MissingManifestResourceException
我在https://bbs.et8.net/bbs/archive/index.php/t-376897.html 看了解释,反而一头更闷了
目录这些都没错吧,但是为什么就找不到这个文件呢? 有人说用thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture('zh-cn');
但是.net compact framework version 2.0是不支持这个的
各位高手,Help Me
我是用资源文件做的
ResourceManager rm = new ResourceManager("TextOne", Assembly.GetCallingAssembly());
string day;
string year;
string months; CultureInfo ci = new CultureInfo("zh-CN");
day = rm.GetString("day", ci); ☜ 这里报错
year = rm.GetString("year", ci);
months = rm.GetString("holiday", ci);
这些代码我是参考
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.chs/fxref_mscorlib/html/3ad9deea-8616-27cd-8364-3313fd47d111.htm
写的
只是在资源文件方面我是自己手动创建的,
TextOne\bin\Debug\zh-CN 和TextOne\bin\Debug\es-ES目录下分别生成了TextOne.resources.dll文件 在报错位置(↑)提示MissingManifestResourceException
我在https://bbs.et8.net/bbs/archive/index.php/t-376897.html 看了解释,反而一头更闷了
目录这些都没错吧,但是为什么就找不到这个文件呢? 有人说用thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture('zh-cn');
但是.net compact framework version 2.0是不支持这个的
各位高手,Help Me
问题解决了···
ResourceManager rm = new ResourceManager("QCMGR.Models", Assembly.GetCallingAssembly());
CultureInfo ci = new CultureInfo("zh-CN");
return rm.GetString("需要替换的文本值", ci);这次用的是一个全局的资源文件
主要的就是在红色字哪里,资源包的命名空间问题