读取:
var imgSizeStr = ConfigurationManager.AppSettings["UploadImgSize"];
写入:
Configuration config = WebConfigurationManager.OpenWebConfiguration("/"); AppSettingsSection app = config.AppSettings; app.Settings["UploadImgSize"].Value = value.ToString(); config.Save(ConfigurationSaveMode.Modified);