Configuration config = ConfigurationManager.
OpenExeConfiguration(ConfigurationUserLevel.None);
//获取AppSettings的节点
AppSettingsSection appsection = (AppSettingsSection)config.GetSection("appSettings");
appsection.Settings["要修改的节点"].Value = 值;
config.Save();
请注意,你调试的时候修改的是\bin\Debug\A.vshost.exe.config
OpenExeConfiguration(ConfigurationUserLevel.None);
//获取AppSettings的节点
AppSettingsSection appsection = (AppSettingsSection)config.GetSection("appSettings");
appsection.Settings["要修改的节点"].Value = 值;
config.Save();
请注意,你调试的时候修改的是\bin\Debug\A.vshost.exe.config