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");
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?
Just cracked this, use:
You could check out
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.See MSDN docs for
GetManifestResourceNames
for details.have a try with this. here you get all files
T is of course your type. so you can use it generic
Try this, returns an array with all .txt files inside Folder directory.
NOTE: Uncomment the
//.Select(...
line in order to get the filename.