gpt4 book ai didi

c# - 使用命令 aspnet_regiis.exe 加密 web.config

转载 作者:行者123 更新时间:2023-11-30 15:07:07 25 4
gpt4 key购买 nike

我的网络配置如下

<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
<add name="MySqlConnection" connectionString="Data Source=server;Initial Catalog=BD;User Id=usr; Password=psswd" />
</connectionStrings>
<system.web>
<!--<authentication mode="Forms" />-->
<roleManager enabled="true" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<!--add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>-->
</assemblies>
</compilation>

<authentication mode="Forms">
<forms loginUrl="login.aspx" name=".ASPXFORMSAUTH"/>
</authentication>
<authorization>
<deny users="?" />
</authorization>


<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MySqlConnection"
applicationName="/"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
<system.codedom>
</system.codedom>

<system.webServer>
</system.webServer>

<system.web>
<caching>
<sqlCacheDependency enabled="true">
<databases>
<add name="AtentoMIG"
connectionStringName="MySqlConnection"
pollTime="5000" />
</databases>
</sqlCacheDependency>
</caching>
</system.web>
<location path="MasterPage">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="assets">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

我需要加密连接字符串,但我找不到我的命令有什么问题它说它找不到属性 connectionString

这是我的命令

aspnet_regiis.exe -pef "configuration/connectionStrings" C:\

最佳答案

删除 configuration/ - 假定:

aspnet_regiis.exe -pef "connectionStrings" C:\

当然,这还假设 web.config 文件位于 c 驱动器的根目录下。

关于c# - 使用命令 aspnet_regiis.exe 加密 web.config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6914377/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com