Edit app.config at runtime.

  • Thread starter Thread starter bede
  • Start date Start date
B

bede

I need to be able to read the contents of my app.config file into a
datagrid and allow the nodes to be edited and saved in the config file
but for the life of me cannot figure it out.

I know I have to work with System.Configuration.ConfigurationManager
but thats about it.

Any ideas ??


Thanks in Advance
 
Hi Bede,

You can't write data to the app.config.

If you really need to, you can always load the app.config into an
XmlDocument.
Or go with an enhanced config file handling:
http://www.codeproject.com/csharp/ReadWriteXmlIni.asp
http://www.codeproject.com/csharp/AnyConfig.asp
http://www.codeproject.com/vb/net/ConfigOpt.asp
http://www.codeproject.com/useritems/appdata.asp

Remember that the config file is loaded with start up only.
So new values needs to be read back with System.XML namespace unless you
restart your app.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top