Solved

How do you retrieve the names of embedded resources

Posted on 2012-03-09
3
312 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connection String 16 54
Entity Framework 7 41
ASP.NET MVC 2 31
How come this regular expression allows "e"? 14 35
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 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