从另一个程序集中检索字符串表
我有一个程序集,我们称之为 A,其中包含一个字符串表,用于将字符串本地化为资源。我还有另一个程序集,称为 B,A 引用它,它必须使用程序集 A 中包含的那些字符串表。
代码现在在程序集 A 中引用该字符串表的方式是这样的:
localResourceManager = new ResourceManager("languageControl", typeof(frm_SomeForm).Assembly);
string someString = localResourceManager.GetString("SomeStringTxt");
形式 frm_SomeForm
是程序集 A 的一部分。
如何在程序集 B 中使用相同的 ResourceManager
而不必将这些相同的字符串表作为程序集 B 中的资源包含在内?
谢谢!
I have an assembly, let's call it A, which contains a string table for localizing strings as a resource. I also have another assembly, called B, which A references to, that has to use those string tables that are contained in assembly A.
The way the code is referencing that string table now in assembly A is this:
localResourceManager = new ResourceManager("languageControl", typeof(frm_SomeForm).Assembly);
string someString = localResourceManager.GetString("SomeStringTxt");
The form frm_SomeForm
is part of assembly A.
How can I use that same ResourceManager
in assembly B without having to include those same string tables as resources in assembly B?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
向程序集 A 添加一个返回其 ResourceManager 的函数。
Add a function to assembly A that returns its ResourceManager.