How can I filterresources from an external assembly by type (text, icons, etc.)?
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hello, I already figured out how to load another assembly from my C# application, and extract the resources embedded to that assembly. My problem is that I'd like to filter the resources by type, i.e. I want to get only text resources, but not icons and other stuff. The code I use at the moment looks like this:
Assembly target = Assembly.LoadFile(filename);
string[] list = target.GetManifestResourceNames();foreach (var listentry in list) { Stream resourceStream = target.GetManifestResourceStream(listentry); var rr = new ResourceReader(resourceStream); IDictionaryEnumerator dict = rr.GetEnumerator(); int ctr = 0; while (dict.MoveNext()) { ctr++; string entry = dict.Value; //I'd like to know what kind of resource this is, how can I do that? } rr.Close(); }
How can I determine which kind of resource entry I currently get, i.e. if it's an icon, a text resource, or something else?