Best way to store const values

  • Thread starter Thread starter elain
  • Start date Start date
E

elain

Hi all,

Is there the best way to store lots of constant values(like error
messages) in asp.net application -- i mean soemwhere that other
persons(who is not a programmer or developer) can change those values
and still can run the application without recompile? Please don't tell
me web.config file, i don't want to mix configuration keys with these
constant values;

thanks,

Elain
 
You could just stored them in a text file and use the StreamReader class to
read them into memory.
 
There are many ways, what we do [referably is that we create another xml
file and a settings object, which can be xml serialized and deserialized for
ease in programming.
Abhijeet Dev
 
Or potentially just a plain vanilla xml file ?
you can have something like
<constants>
<constant name="const1" value="abc" />
<constant name="const2" value="999" />
</constants>

or

<constants>
<constant>
<name>const1</name>
<value>abc</value>
</constant>
<constant>
<name>const2</name>
<value>999</value>
</constant>
</constants>
 
Back
Top