So i have few questions about .net application settings. I have added an application settings and i can add and remove settings but my question is is there a way to add a table of settings. For example i have in the settings file :
NumberOfPrinetrs int 4
SomethingElse string dsffds
Is there a way to add
Printer1
location string xxxxx
number int xxxxx
Printer2
location string xxxxx
number int xxxxx
and another question is it possible to add additional settings at runtime and if it is possible how?
Thanks for all the help in advance and Merry Christmas to all!
You could separate your values with a ‘,’ and ‘;’ and then parse them when reading.
In such a way you can still access them like your normal
NumberOfPrintersandSomethingElsevalues.I would create a wrapper class that handles this for you and that you can use every time you need some printer information.
Your wrapper class would then expose a list(or dictionary) of Printer objects with the properties Name, Location and Number.