To modify strong password rules in asp.net2.0 built-in member management

Source: Internet
Author: User
Tags config modify alphanumeric characters strong password
asp.net

  Error Tip:

The minimum password length is 7, which must contain the following non-alphanumeric characters: 1

  Solution:

Received the above message is mainly in the creation of users, when the use of ASP.net Web site management tools to create users will also be generated. The main reason is that the password input does not meet the requirements, to change the above provisions, there are two main methods:

1. All sites are changed.

Find Machine.config file

<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>

There are two attributes, one is minrequiredpasswordlength, meaning the longest password, the default is 7 and the other is minRequiredNonalphanumericCharacters, the default is 1, meaning there is at least one non-alphanumeric character, Just change it to 0.

  2. If only to a certain site, just modify the value of Web.config OK

To modify the above, insert the above code in the <system.web> below OK.

To change to a password rule is "at least 6 characters without special characters," as follows:
(Note: Be sure to add <remove name= "AspNetSqlMembershipProvider"/>, or you will be prompted "item" AspNetSqlMembershipProvider "added" error message)

<membership>
<providers>
<remove name= "AspNetSqlMembershipProvider"/>
<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= "6"
minrequirednonalphanumericcharacters= "0"
passwordattemptwindow= "10"
Passwordstrengthregularexpression= ""/>
</providers>
</membership>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.