Hi,
You cannot, it;s readonly. I had a link somewhere explaining the reasons
behind this. One is that the changes in it will affect all the users of the
app, not the particular user that did it.
If you need to store changing values you can use the registry or even better
create your own config file and store it in the user ApplicationData folder
: Environment.Spe cialFolder.Appl icationData
See opennetcf.org library for a good implementation of a config like class.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Alberto" <al*****@nospam .es> wrote in message
news:OW******** ********@TK2MSF TNGP05.phx.gbl. ..
I need to modify a value in the app.config file with this code:
System.Configur ation.Configura tion config =
ConfigurationMa nager.OpenExeCo nfiguration(Con figurationUserL evel.None);
string key = "Path";
string value = "New value";
config.AppSetti ngs.Settings.Ad d(key, value);
config.Save(Con figurationSaveM ode.Modified);
ConfigurationMa nager.RefreshSe ction("appSetti ngs");
It doesn't write the file. Could you tell me how to do it?
Thank you