基本过程如下:
1、用类ResXResourceWriter将字符串资源生成Resx文件,
2、利用ResGen.exe将Resx文件转换成Resources文件,
3、使用al.exe将Resources文件封装为DLL,
4、请问在不修改主程序的前提下,如何才能在主程序中利用CultureInfo与ResourceManager调用改该DLL文件,获取其中的字符串资源。我调用的时候总返回错误:未处理的“System.Resources.MissingManifestResourceException”类型的异常出现在 mscorlib.dll 中。其他信息: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "CreateLanguagePackage.zh-HK.resources" was correctly embedded or linked into assembly "CreateLanguagePackage" at compile time, or that all the satellite assemblies required are loadable and fully signed.
1、用类ResXResourceWriter将字符串资源生成Resx文件,
2、利用ResGen.exe将Resx文件转换成Resources文件,
3、使用al.exe将Resources文件封装为DLL,
4、请问在不修改主程序的前提下,如何才能在主程序中利用CultureInfo与ResourceManager调用改该DLL文件,获取其中的字符串资源。我调用的时候总返回错误:未处理的“System.Resources.MissingManifestResourceException”类型的异常出现在 mscorlib.dll 中。其他信息: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "CreateLanguagePackage.zh-HK.resources" was correctly embedded or linked into assembly "CreateLanguagePackage" at compile time, or that all the satellite assemblies required are loadable and fully signed.
因为我没用你那工具生成过资源DLL,所以不晓得该DLL里面你调用的资源类的命名空间和类型
反正baseName的值是命名空间+类名.
ResourceManager 构造函数的baseName和 assmbly参数都填对了. 你再用刚才生成的ResourceManaager的对象,就可以调用里面的方法了,如果是字符串,就用GetString, 如果是类类型的,就用GetObject, 用错方法也会报错的