>I read a encrypted text file which contains details of SQL Server name, SQL DBName etc...
for DB Connection and i prepare a connection string for global use.
I also read from a book, that the connection string can be placed in "appname.exe.config"
file for windows application.
Is there any way to write/append key value pairs into the config file at run time.
Not out of the box, no. By default, the myapp.exe.config files are
considered read-only, which makes good sense if you think about it -
they'll be located in the same directory as the app, which normally
isn't one that the average user (at least in a corporate environment)
has write access to anyway.
Since the .config files are nothing but straight XML files, you can
easily write your own class to load the existing XML config file, add
or modify entries, and write the XML file back. MIND YOU: check for
permission to do so!! You might not be able to write it back (since
your user running your app might not have write permission where the
file is located).
Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch