如何使用 regiis_asp.net 解密 web.config 中的连接字符串?

发布于 2024-12-14 08:40:18 字数 235 浏览 0 评论 0原文

我尝试过在 cmd 中使用此命令,但它不起作用,

c:/path.../regiis_asp.net -pi "connectionString" -app "d:/myWebSiteApp" 

该命令的结果是

the configuration section "connectionString" was not found
failed

I have tried using this command in cmd but it didn't work

c:/path.../regiis_asp.net -pi "connectionString" -app "d:/myWebSiteApp" 

the result of that command was

the configuration section "connectionString" was not found
failed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小情绪 2024-12-21 08:40:18

你试过这样吗?:

加密:

aspnet_regiis.exe -pef "connectionStrings" C:\path\to\application

解密:

aspnet_regiis.exe -pdf "connectionStrings" C:\path\to\application

Have you tried it this way?:

Encrypt:

aspnet_regiis.exe -pef "connectionStrings" C:\path\to\application

Decrypt:

aspnet_regiis.exe -pdf "connectionStrings" C:\path\to\application
蓝眼睛不忧郁 2024-12-21 08:40:18

如果您的目的是解密 web.config 中的 connectionStrings 部分,则必须使用以下命令。

aspnet_regiis -pdf "connectionStrings" -app "d:/MyWebsiteApp"

注意:在您提供的代码中,请注意以下内容

1) 实用程序命令是 aspnet_regiis 而不是 regiis_asp.net

2) 由于您的应用程序是从物理路径引用的,容器配置必须是-pdf而不是-pi

3)节名称是connectionStrings而不是connectionString (注意's')

如果您尝试从虚拟路径解密,则命令必须如下所示

aspnet_regiis -pd "connectionStrings" -app "/MyWebsiteApp"

If your intention is to decrypt the connectionStrings section in the web.config, you will have to use the below command.

aspnet_regiis -pdf "connectionStrings" -app "d:/MyWebsiteApp"

Note: in the code provided by you, please note the following

1) the utility command is aspnet_regiis instead of regiis_asp.net

2) Since your app is referred from the physical path, the container configuration must be -pdf instead of -pi

3) The section name is connectionStrings instead of connectionString ( notice the 's')

If you are trying to decrypt from the virtual path then the command must be as below

aspnet_regiis -pd "connectionStrings" -app "/MyWebsiteApp"
当爱已成负担 2024-12-21 08:40:18

刚刚有了这个,结果发现它不需要在连接字符串周围使用双引号。

Just had this and it turned out that it didn't want the double quotes around connectionStrings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文