首页 > 代码库 > 给config加密

给config加密

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