2011-07-13 79 views
1

我改變了我的密碼格式在web.config中的散列加密的,並增加了機器的關鍵,但之後,我得到這個錯誤:asp.net更改密碼的格式問題

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

是什麼問題,謝謝。

回答

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>