加密—— pef aspnet_regiis.exe -pef "connectionStrings" "你的web.config所在的文件夹" -prov "DataProtectionConfigurationProvider" 解密—— pdf aspnet_regiis.exe -pdf "connectionStrings" "你的web.config所在的文件夹" 特别是最后的路径,可一定要正确,否则是没有什么效果的。