There is a lot of information out there, but so far I havent
been able
to put it all together in my head to understand how to best
do what I
need to do.
The problem:
I want to use the app.config file to store some
configuration
information for a backup tool I am writing. I know a little
bit about
ConfigurationManager.AppSettings
but I cant find out how to have multiple groups of data to
draw on.
What I hope to accomplish is providing a config file that
can be user
edited to allow the program to do different things. For
example I will
have a list of key value pairs consisting of databases to
backup and a
value of yes or no (or true or false)
I envision the config file to look something liek this
<configuration>
<generalSettings>
<add key="backUpSettings value = "true
/>
<add key="vaultSettings"
value="false" />
<backUpSettings>
<add key="pubs" value="true"
/>
<add key="Northwind"
value="true" />
<add key="master"
value="false" />
</backUpSettings>
<vaultSettings>
<add key="prod1"
value="false" />
<add key="prod2"
value="false" />
<add key= "prod3"
value="false" />
</valutSettings>
Now the user can edit the config file and simply change the
values from
false to true or back respectively to control how the backup
tool
operates
I envision (once I understand how to write the code ) that
the code
will read the config file, determine if the valult is
active, determine
if the regular backup is active, and then upon the answer
grap the
entire key value collection for the respective section, dump
it into
either a hashtable or some other key value collection and
process the
information
Is something like that even possible, while Im at it if
possible I
would like to do this with the latest (2.0) Configuration
Data Block
(In the Enterprise Library 2.0), but again I can find only
sketchy
information and no examples (that I can understand) to do
what I want
to do.
I would appreciate any help anyone can give.
I looked for a group FAQ but could not find one, so if you
have one
just point me to that and I will do some more reasearch.
Thanks for the help
-SteveM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharp googlegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribe googlegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---
|