MembershipProvider.MinRequiredPasswordLength 属性

定义

获取密码所要求的最小长度。Gets the minimum length required for a password.

public:
 abstract property int MinRequiredPasswordLength { int get(); };
public abstract int MinRequiredPasswordLength { get; }
member this.MinRequiredPasswordLength : int
Public MustOverride ReadOnly Property MinRequiredPasswordLength As Integer

属性值

密码所要求的最小长度。The minimum length required for a password.

示例

下面的示例显示了应用程序的 web.config 文件的system.web部分中的成员资格元素(ASP.NET 设置架构)配置元素。The following example shows the membership Element (ASP.NET Settings Schema) configuration element in the system.web section of the application's Web.config file. 它指定应用程序使用SqlMembershipProvider类的实例来提供成员身份服务,并将该minRequiredPasswordLength属性设置为七个字符。It specifies that the application use an instance of the SqlMembershipProvider class to provide membership services, and sets the minRequiredPasswordLength attribute to seven characters.

<membership defaultProvider="SqlProvider"  
  userIsOnlineTimeWindow = "20>  
  <providers>  
    <add  
      name="SqlProvider"  
      type="System.Web.Security.SqlMembershipProvider"  
      connectionStringName="SqlServices"  
      requiresQuestionAndAnswer="true"  
      minRequiredPasswordLength="7"  
      />  
  </providers>  
</membership>  

注解

属性获取为MembershipProvider对象创建有效密码时必须输入的最小字符数。 MinRequiredPasswordLengthThe MinRequiredPasswordLength property gets the minimum number of characters that must be entered to create a valid password for the MembershipProvider object.

属性值是minRequiredPasswordLength使用成员资格元素(ASP.NET 设置架构)配置元素的特性在应用程序配置中设置的。 MinRequiredPasswordLengthThe MinRequiredPasswordLength property value is set in the application configuration using the minRequiredPasswordLength attribute of the membership Element (ASP.NET Settings Schema) configuration element.

适用于

另请参阅