Solved

How do you retrieve the names of embedded resources

Posted on 2012-03-09
3
321 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)
0
Comment
Question by:KevinBengo
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37705024
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.
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 37713599
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/
0
 

Author Closing Comment

by:KevinBengo
ID: 37716567
Thanks. It was helpful
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question