开发者

ASP.NET Membership Provider password configuration

开发者 https://www.devze.com 2022-12-24 15:02 出处:网络
How can I set up membership provid开发者_StackOverflower to only accept passwords that adhere to the following rules:

How can I set up membership provid开发者_StackOverflower to only accept passwords that adhere to the following rules:

Minimum 6 characters

Contains at least one letter and number

Should be case sensitive


You can add/set the membership provider of your choice or alter default settings in web.config file. Under < system.web > section you may set:

<system.web>
    <authentication mode="Forms"/>
    <membership defaultProvider="...">
        <providers>
            <add name="MyProvider" passwordStrengthRegularExpression="reg. expression" ...other stuff.../>
        </providers>
    </membership>
</system.web>

Using the passwordStrengthRegularExpression property you can use a regular expression to specify the format of valid passwords. This is the most flexible way to control the format of a valid password in your application.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号