asp.net网站中配置文件的加密

打开:开始-》程序-》Microsoft Visual Stdio 2005-》Visual Stdio tools-》Visual Stdio 2005命令提示

加密:aspnet_regiis -pe "connectionStrings" -app "/smpweb"

解密:aspnet_regiis -pd "connectionStrings" -app "/smpweb"

加密后浏览网站有时可能会出现以下错误:

未能使用提供程序“RsaProtectedConfigurationProvider”进行解密。提供程序返回 。错误消息为: 打不开 RSA 密钥容器。

解决办法如下:

命令:aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"

注意事项:XP下:aspnet_regiis -pa "NetFrameworkConfigurationKey" "aspnet"

 

原文地址:https://www.cnblogs.com/yunfei181/p/1650687.html