// Get configuration. Configuration config = WebConfigurationManager.OpenWebConfiguration(path); ConfigurationSection appSettings = config.GetSection("appSettings"); if (appSettings.SectionInformation.IsProtected) ...{ appSettings.SectionInformation.UnprotectSection(); } else ...{ appSettings.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); }
try ...{ config.Save(); UpdateUI(); } catch (Exception ex) ...{ Response.Write("In order to modify configuration settings, the ASP.NET process account (either the local ASPNET or Network Service account, by default) "); Response.Write("must have write permission granted for the Web.config file in the sample directory"); } }