public static void SetAppKey(string keyName, string keyValue)
{
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);
AppSettingsSection appSection = (AppSettingsSection)config.GetSection("appSettings");
if(appSection.Settings[keyName] != null)
appSection.Settings[keyName].Value = keyValue;
config.Save();
}
asp.net写入web.config
最新推荐文章于 2019-04-02 14:57:35 发布