"connectionStrings" 路径是web.config所在的工程目录.

1、加密EncryptWebConfig.bat

@echo off
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "D:\Web"
PAUSE

2、解密DecryptWebConfig.bat

@echo off
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pdf "connectionStrings" "D:\Web"
PAUSE

加黑的就是两个文件的区别。

 

注:这种方法加密的,只能在执行加密的电脑上使用,因为asp.net自动解密时需要用到机器特征码,所以加密时在服务器上加密即可,

如果是要布属到多台服务器,则需要用到RSA 密钥容器,

有关RSA 密钥容器另做说明

相关文章:

  • 2021-10-25
  • 2021-11-13
  • 2021-12-22
  • 2022-12-23
  • 2021-07-05
  • 2021-10-24
猜你喜欢
  • 2021-11-12
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2021-09-06
  • 2022-02-15
  • 2022-12-23
相关资源
相似解决方案