Andrea,
The .NET Framework does not let you modify config files via the classes in
System.Configuration.
If you have to modify them, then you can do so by hand with the XmlDocument
class or with the Configuration Management Application Block [0].
However, modifying the .config files has its own set of issues that may
collide with the development guidelines for windows applications.User
specific settings, for example should not be stored in the application
directory (where app.config resides), but in the user's folder \documents
and settings\username\LocalSettings\<blablabla>
HTH,
Christoph Schittko
Software Architect, .NET Mentor
MS MVP XML .NET
[0]
http://www.gotdotnet.com/Community/W...e-fa4bf2e3080f
"andrea" <le**********@hotmail.com> wrote in message
news:ee**************@tk2msftngp13.phx.gbl...
hello,
I ve a Windowsapplication with a configuration file app.config... (it's in
xml)
code app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name = "MyNameValueSection"
type="System.Configuration.NameValueSectionHandler " />
</configSections>
<MyNameValueSection>
<add key="MyKey" value="MyValue" />
</MyNameValueSection>
<appSettings>
<add key="test" value="MeinInhalt" />
</appSettings>
</configuration>
I want to change in my c# programm the values of "test" and "MyKey"...
any information or samples would be helpful
thanx a lot in advance
Andrea