列出所有嵌入的资源文件夹中 [英] List all embedded resources in a folder

查看:132
本文介绍了列出所有嵌入的资源文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的解决方案曾与几个文件的文件夹。 。所有这些文件具有生成操作嵌入的资源

In my solution a had a folder with a few files. All this files have the Build Action "Embedded Resource".

有了这个代码,我可以得到一个文件:

With this code I can get a file:

assembly.GetManifestResourceStream(assembly.GetName().Name + ".Folder.File.txt");



但是,有没有什么办法让所有的 *。txt的此文件夹中的文件?名称或方法的列表都看?

But is there any way to get all *.txt files in this folder? A list of names or a method to iterate through them all?

推荐答案

您可以检查出

assembly.GetManifestResourceNames()

返回包含的所有资源的字符串数组。然后,您可以过滤列表来查找所有 *。txt的存储为嵌入的资源文件。

which returns an array of strings of all the resources contained. You could then filter that list to find all your *.txt files stored as embedded resources.

请参阅 MSDN文档为GetManifestResourceNames 的详情。

这篇关于列出所有嵌入的资源文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆