如何使用 aspnet_regiis.exe -pef 一次加密多个 Web.config-sections?

ced*_*lof 2 asp.net iis encryption web-config aspnet-regiis.exe

通过运行:

aspnet_regiis.exe -pef "connectionStrings" C:\inetpub\wwwroot\Site
Run Code Online (Sandbox Code Playgroud)

我可以加密我的连接字符串。但是,我想同时加密另一个部分。有什么方法可以给多个参数-pef

就像是:

aspnet_regiis.exe -pef "connectionStrings,applicationSettings/Project" C:\inetpub\wwwroot\Site
Run Code Online (Sandbox Code Playgroud)

小智 5

通过在 DOS .bat 文件中执行 aspnet_regiis 两次,我成功地使用 aspnet_regiis 加密(和解密)了 connectionStrings 和 appSettings 这两个部分。看起来您必须为要加密(和解密)的每个部分执行一次 aspnet_regiis。