I have a plenty of them of different form and types. Of course I will not store a bitmap as const
, and I know about localization strings, but what should I do with other constants?
resx resource file format consists of XML entries. These XML entries specify objects and strings inside XML tags. It can be easily manipulated.
Resources in . resx files. Unlike text files, which can only store string resources, XML resource (. resx) files can store strings, binary data such as images, icons, and audio clips, and programmatic objects.
Call the ResXResourceWriter. AddResource method for each resource you want to add to the file. Use the overloads of this method to add string, object, and binary (byte array) data. If the resource is an object, it must be serializable.
Put constants that relates to UI display in resources.
Put "constants" relating to application configuration like connection strings in app.config
Put constants that relates to program flow in c# classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With