怎么加密~~
要实例~
------解决方案--------------------------------------------------------
private void EncryptConfig(bool bEncrypt)
{
string path = "/Test ";
Configuration config = WebConfigurationManager.OpenWebConfiguration(path);
ConfigurationSection appSettings = config.GetSection( "connectionStrings ");//appSettings这样加密appSettings
if (bEncrypt)
{
appSettings.SectionInformation.ProtectSection( "DataProtectionConfigurationProvider ");//加密
}
else
{
appSettings.SectionInformation.UnprotectSection();//解密
}
config.Save();
}