构建新的限制用户成员资格的限制 [英] Construction of new restrictions on changing user membership

查看:89
本文介绍了构建新的限制用户成员资格的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以爱与正义的名义
尊敬的朋友大家好,

当我使用创建新用户的命令成员身份时,存在一些限制.例如,密码字符和字符类型的数量应为字母,数字和符号的组合.我们应该如何更改它们并消除我们Membership.CrearteUser ("UserName", "Password", "Email")的限制?

In the name of love and justice
Hello to all dear friends,

When membership of the command to create a new user I use there are limits. For example, the number of password characters and character types that should Combination of letters and numbers and signs are. How should we change them and remove the restrictions that we Membership.CrearteUser ("UserName", "Password", "Email")?

推荐答案

您可以使用web.config文件控制此操作,例如-看看这个例子config

You can control this with your web.config file, e.g. - look at this example config

<roleManager enabled="true" defaultProvider="TestApplicationRoleProvider">
    <providers>
        <clear/>
        <add name="TestApplicationRoleProvider"

        connectionStringName="AspNetDbSecurityDatabase"

        applicationName="TestApplication"

        type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </providers>
</roleManager>
<profile>
    <providers>
        <clear/>
        <add name="TestApplicationProfileProvider"

        connectionStringName="AspNetDbSecurityDatabase"

        applicationName="TestApplication"

        type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </providers>
</profile>
<membership defaultProvider="TestApplicationMembershipProvider">
    <providers>
        <clear/>
        <add name="TestApplicationMembershipProvider"

     connectionStringName="AspNetDbSecurityDatabase"

     enablePasswordRetrieval="false"

     enablePasswordReset="true"

     requiresQuestionAndAnswer="false"

     applicationName="TestApplication"

     requiresUniqueEmail="true"

     passwordFormat="Encrypted"

     maxInvalidPasswordAttempts="10"

     minRequiredPasswordLength="6"

     minRequiredNonalphanumericCharacters="0"

     passwordAttemptWindow="10"

     passwordStrengthRegularExpression="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,15}


" 类型 = " / > < /提供者 > < /成员身份 >
" type="TestApplication.Site.TestApplicationMembershipProvider"/> </providers> </membership>




查看成员资格提供程序中的设置.请注意minRequirePasswordLength,minRequiredNonalphanumericCharacters和本示例中的passwordStrengthRegularExpression,它将检查用户根据RegEx输入的密码.

成员资格提供程序配置 [




Look at the setting in the Membership Provider. Notice the minRequirePasswordLength, minRequiredNonalphanumericCharacters and in this example a passwordStrengthRegularExpression which will check the password entered by the user against a RegEx.

The membership provider configuation[^] is where you control these settings


可以放置示例程序
当我运行时,这些部件与提供程序错误有关
Friends who can put a sample program
When I''m running the parts are related to provider error


这篇关于构建新的限制用户成员资格的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆