2

In the [AppName].g.resources file, how do I enumerate through all the resources inside?

For example, there is:
readme.txt
images/logo.png
images/img.jpg

...etc

I know how to read them individually, but what if I want to get all resources from the "folder" images?

UPDATE: Oops my bad ^^ Duplicate of Enumerating .NET assembly resources at runtime

Community
  • 1
  • 1
  • 2
    try exploring Application.Current.Resources – Haris Hasan Dec 09 '11 at 06:43
  • I did but no luck :( It doesn't return items compiled under "Resources" in VS2010 –  Dec 09 '11 at 08:12
  • Don't confuse Application.Current.Resources with the resources located in your assembly. The first is for ResourceDictionaries and WPF object. The second is for files/images/etc. – Arcturus Dec 09 '11 at 10:36

1 Answers1

0

Try the GetResourceStream method present in Assembly class to get the stream to resource file.

http://msdn.microsoft.com/en-us/library/ms596994(v=VS.100).aspx

I dont think you can enumerate like how you do for folders.

Another way is get resource names http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getmanifestresourcenames.aspx

Community
  • 1
  • 1
Joy George Kunjikkuru
  • 1,495
  • 13
  • 27