【发布时间】: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