代码如下
public void SetAppSettingValue(string app_name, string value)
{
Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
AppSettingsSection app = config.AppSettings;
app.Settings[app_name].Value = value;
config.Save(ConfigurationSaveMode.Modified);
}
如果不能修改,请设置好相应的权限已供访问,比如everyone