从引用的程序集中读取 .resx 文件名

发布于 2024-12-25 09:19:21 字数 318 浏览 4 评论 0原文

我想从引用的程序集上的文件夹中检索可用的资源文件。我可以访问程序集并获取如下名称:

System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(AppResources));
string[] names = assembly.GetManifestResourceNames();

但这并没有提供我需要的名称,即 AppResources.resx、AppResources.en-US.resx 等。我如何读取这些名称?

多谢

I want to retrieve the available resource files from a folder on a referenced assembly. I can access the assembly and get the names like this:

System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(AppResources));
string[] names = assembly.GetManifestResourceNames();

But this doesn't give me the names I need, which are AppResources.resx, AppResources.en-US.resx, etc. How can I read those names?

Thanks a lot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人海汹涌 2025-01-01 09:19:21

您将在 GetManifestResourceNames 中找到 AppResources.resx 作为

NamespaceOfAppResources 。应用程序资源。资源

语言特定资源不位于主程序集中。

请参阅处理程序集资源:
http://www.codeproject.com/KB/dotnet/Extracting_Embedded_Image.aspx

You will find AppResources.resx in GetManifestResourceNames as

NamespaceOfAppResources . AppResources . resources

language specific resources are not located in the main assembly.

See handling assembly resources:
http://www.codeproject.com/KB/dotnet/Extracting_Embedded_Image.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文