加密web.config数据库连接

加密
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis.exe -pef "connectionStrings" "D:\网站发布\NX"

解密
aspnet_regiis.exe -pdf "connectionStrings" "D:\网站发布\NX"


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

进dos运行:aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"
如果运行出错,需要把目录 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 放入环境变量path中。

猜你喜欢

转载自www.cnblogs.com/idtjie/p/10893908.html