How can I filter resources from an external assembly by type (text, icons, etc.)?
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:
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 开发者_JAVA技巧resource entry I currently get, i.e. if it's an icon, a text resource, or something else?
Thanks a lot.
精彩评论