使用NET2.0创建用户时会遇到“密码最短长度为 7,其中必须包含以下非字母数字字符: 1。”这样的提示;
当按照提示输入时还会有错误,那么有以下方法:
1、使用强密码:数字、字母、符号组成的大于7位数的密码;
2、以下方法来源于网络
找到machine.config文件
<
membership
>
< providers >
< add name ="AspNetSqlMembershipProvider"
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 ="7"
minRequiredNonalphanumericCharacters ="1"
passwordAttemptWindow ="10"
passwordStrengthRegularExpression ="" />
</ providers >
</ membership >
< providers >
< add name ="AspNetSqlMembershipProvider"
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 ="7"
minRequiredNonalphanumericCharacters ="1"
passwordAttemptWindow ="10"
passwordStrengthRegularExpression ="" />
</ providers >
</ membership >
里面有两个属性,一个是 minRequiredPasswordLength,意思是最长密码,默认为7另一个是minRequiredNonalphanumericCharacters,默认为1,意思是至少有一个非字母字符,只要把它改成0就可以了。
假如只是对某一个站点,只要修改web.config的值就ok了
修改如上,把上面的代码插入在<system.web>下面就ok了。