Configuration config = WebConfigurationManager.OpenWebConfiguration("/");
            ConfigurationSection appSettings = config.GetSection("appSettings");
            if (appSettings.SectionInformation.IsProtected)
            {
                appSettings.SectionInformation.UnprotectSection();
            }
            else
            {
                appSettings.SectionInformation.ProtectSection(
                "DataProtectionConfigurationProvider");
            }
            config.Save();

 

posted on 2014-07-29 10:58  王洪洪  阅读(174)  评论(0编辑  收藏  举报