4

我正在使用 sql server 和自定义数据库来存储成员提供程序表。在我的 webconfig 文件中,我降低了密码强度,但成员仍需要应用默认密码强度。以下是webconfig设置

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

1 回答 1

5

您需要将您的会员提供者设置为默认提供者。否则它将使用Machine.Config.

<membership defaultProvider="AspNetSqlProvider" userIsOnlineTimeWindow="30">
  <providers>
    <clear/>
    <add name = "AspNetSqlProvider"
 type = "System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, 
 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
 connectionStringName = "LocalSqlServer"
 enablePasswordRetrieval = "false"
 enablePasswordReset = "true"
 requiresQuestionAndAnswer = "true"
 applicationName = "/"
 requiresUniqueEmail = "false"
 passwordFormat = "Hashed"
 maxInvalidPasswordAttempts = "5"
 minRequiredPasswordLength = "6"
 minRequiredNonalphanumericCharacters = "0"
 passwordAttemptWindow = "10"
 passwordStrengthRegularExpression = "" />
  </providers>
</membership>
于 2012-05-03T01:32:18.630 回答