We help IT Professionals succeed at work.

How do you retrieve the names of embedded resources

Medium Priority
435 Views
Last Modified: 2012-03-13
Hello

(Language C#, Visual  Studio 2005)

This is driving me nuts because it is something I've done before but can't recreate. I'm trying to:
1. Get the full path to where the embedded resources are.
2. Get the names of the embedded resource files.

using code-
            System.Reflection.Assembly thisExe =
            System.Reflection.Assembly.GetExecutingAssembly();
            string[] resources = thisExe.GetManifestResourceNames();

Almost gets me the names of everything including:
[programname].Properties.Resources.resources

But I can't retrieve the file names that are contained within the ".resources"

Thanks a lot (and please don't forget about question 1)
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
If you have the full resource name, you might be able to use Assembly.GetManifestResourceStream, and use an appropriate stream reader to get the contents.
Full stack Software Engineer
CERTIFIED EXPERT
Commented:
try this:

System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();

here's a tutorial:
http://hajloo.wordpress.com/2009/12/14/%E2%80%AAhow-to-read-embedded-resource-in-c/

Author

Commented:
Thanks. It was helpful

Explore More ContentExplore courses, solutions, and other research materials related to this topic.