网站中大部分配置存储在web.config的appSettings节中,可以通过System.Web.Configuration.WebConfigurationManager.AppSettings.Get读取相应的节,如何设置这些节点的值并保存呢? 修改web.config的内容可以使用
Configuration cfg = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); AppSettingsSection appSetting = cfg.AppSettings; appSetting.Settings["a"].Value = "changed by application"; cfg.Save();
代码修改web.config
最新推荐文章于 2023-06-18 11:35:06 发布