简体   繁体   中英

Read .resx file names from a referenced assembly

I want to retrieve the available resource files from a folder on a referenced assembly. I can access the assembly and get the names like this:

System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(AppResources));
string[] names = assembly.GetManifestResourceNames();

But this doesn't give me the names I need, which are AppResources.resx, AppResources.en-US.resx, etc. How can I read those names?

Thanks a lot

You will find AppResources.resx in GetManifestResourceNames as

NamespaceOfAppResources . AppResources . resources

language specific resources are not located in the main assembly.

See handling assembly resources: http://www.codeproject.com/KB/dotnet/Extracting_Embedded_Image.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM