app.config 读写问题
我现在写了一个app.config文件如下:<?xml version="1.0" encoding="utf-8" ?><configuration>
<configSections>
<section name="Test1" type="System.Configuration.SingleTagSectionHandler"/>
<section name="Test2" type="System.Configuration.DictionarySectionHandler"/>
<section name="Test3" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<appSettings>
</appSettings>
<Test1 setting1="Hello" setting2="World"/>
<Test2>
<add key="Hello" value="World" />
</Test2>
<Test3>
<add key="Hello" value="World" />
</Test3>
</configuration>
我现在能读 ,但是我想写写不了,改不了test1中的值,请问各位高人怎么写啊?下面是我的读方法:System.Collections.IDictionary IDTest1 = (System.Collections.IDictionary)System.Configuration.ConfigurationManager.GetSection("Test1");
string str = (string)IDTest1["setting1"] + " " + (string)IDTest1["setting2"];
MessageBox.Show(str);