Assuming that you know the resource names from the external source and are only lacking the capitalization, this function creates a dictionary you can use for lookups to align the two sets of names.
you know -> externally provided
MyBitmap -> MYBITMAP
myText -> MYTEXT
/// <summary>
/// Get a mapping of known resource names to embedded resource names regardless of capitlalization
/// </summary>
/// <param name="knownResourceNames">Array of known resource names</param>
/// <returns>Dictionary mapping known resource names [key] to embedded resource names [value]</returns>
private Dictionary<string, string> GetEmbeddedResourceMapping(string[] knownResourceNames)
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
string[] resources = assembly.GetManifestResourceNames();
Dictionary<string, string> resourceMap = new Dictionary<string, string>();
foreach (string resource in resources)
{
foreach (string knownResourceName in knownResourceNames)
{
if (resource.ToLower().Equals(knownResourceName.ToLower()))
{
resourceMap.Add(knownResourceName, resource);
break; // out of the inner foreach
}
}
}
return resourceMap;
}