Add resource strings dynamically

Is it possible to dynamically add resource strings on the fly to resource files? What if multi-language efforts are involved?

+6
c #
source share
2 answers

Take a look at the resourceWriter class on MSDN: http://msdn.microsoft.com/en-us/library/system.resources.resourcewriter.aspx

This class will do all the heavy lifting in terms of file I / O and data formatting. There is also a great tutorial on how to use it: http://www.c-sharpcorner.com/UploadFile/yougerthen/105232008045338AM/1.aspx

Hope this helps.

+8
source share

Resource files are compiled binaries (technically they are assemblies, but they do not contain executable code), and the ResourceManager that works with these resource files is thus read-only.

What you can do is define a separate configuration file referenced by the app.config file containing the installation-related data as a custom ConfigurationSection or simply as AppSettings. You can then use the ConfigurationManager to load, read, and write these lines.

+1
source share

All Articles