Find all embedded resources in another assembly

I'm working on localization for my project. For this, I have a class which should load an embedded resource from another assembly, and then read out the strings.

But also I need to know which resource files this assembly contains. The number and which languages those are, is unknown.

So how do I find out how the ".resx" file in this assembly is named? Those all have the same scheme: "de-DE.resx", "en-US.resx", and so on.

I need to know how many of those files are contained in this assembly, and which languages they are.

I know that the ResourceManager has access to them, thus it should be possible to access this information programatically too...


您应该使用Assembly类(msdn)中的GetManifestResourceNames方法:

string[] resourceNames = this.GetType().Assembly.GetManifestResourceNames();
foreach(string resourceName in resourceNames)
{
    Console.WriteLine(resourceName);
}
链接地址: http://www.djcxy.com/p/23716.html

上一篇: 如何在没有Global.asax的ASP.NET中获得Web应用程序程序集?

下一篇: 在另一个程序集中查找所有嵌入式资源