【问题标题】:asp.net changing password format problemasp.net修改密码格式问题
【发布时间】:2011-10-04 09:07:55
【问题描述】:

我将 web.config 中的密码格式更改为加密并添加了一个机器密钥,但之后我收到了这个错误:

Format of the initialization string does not conform to specification starting at index 0

我尝试改回散列,但仍然出现此错误。

这是会员代码:

        <membership>
        <providers>
            <remove name="AspNetSqlMembershipProvider"/>
            <add name="AspNetSqlMembershipProvider"
                 type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionString="LocalSqlServer"
                 enablePasswordRetrieval="false"
                 enablePasswordReset="true"
                 requiresQuestionAndAnswer="false"
                 applicationName="/"
                 requiresUniqueEmail="true"
                 minRequiredPasswordLength="6"
                 minRequiredNonalphanumericCharacters="0"
                 passwordFormat="Encrypted"
                 maxInvalidPasswordAttempts="5"
                 passwordAttemptWindow="10"
                 passwordStrengthRegularExpression=""/>
        </providers>    
    </membership>

和连接字符串:

    <connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=AHMED-PC\SQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=123456" providerName="System.Data.SqlClient"/>
</connectionStrings>

注意:在我更改密码格式之前,连接字符串工作正常。

使用 asp.net 4.0

有什么问题,谢谢。

【问题讨论】:

    标签: asp.net passwords asp.net-membership


    【解决方案1】:

    通过附加 ASPNETDB.MDF 文件并从连接字符串中删除初始目录来解决它:

          <connectionStrings>
       <remove name="localsqlserver"/>
            <add name="localsqlserver" connectionString="Data Source=AHMED-PC\SQLEXPRESS;AttachDBFilename=|DataDirectory|aspnetdb.mdf;Persist Security Info=True;User ID=sa;Password=123456" providerName="System.Data.SqlClient"/> 
    </connectionStrings>
    

    【讨论】:

      猜你喜欢
      • 2015-01-05
      • 1970-01-01
      • 2011-11-21
      • 1970-01-01
      • 1970-01-01
      • 2020-01-25
      • 2020-10-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多