PasswordRegularExpression

CreateUserWizard.PasswordRegularExpression
Note: This property is new in the .NET Framework version 2.0.

Gets or sets a regular expression used to validate the provided password.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

Visual Basic (Declaration)
Public Overridable Property PasswordRegularExpression As String
Visual Basic (Usage)
Dim instance As CreateUserWizard
Dim value As String
value = instance.PasswordRegularExpression
instance.PasswordRegularExpression = value

Remarks

Use the PasswordRegularExpression property to define the requirements for passwords used to validate users on your Web site. A common use is to make sure that a user has included symbols other than letters in a password to make it harder for attackers to guess a password. The regular expression is used in addition to any restrictions placed on the password by the membership provider specified in the MembershipProvider property. If the membership provider rejects the password for any reason, the text contained in the InvalidPasswordErrorMessage property is displayed.If the password entered does not pass the regular expression, the error message contained in the PasswordRegularExpressionErrorMessage property is displayed to the user.
Example

The following code example uses the PasswordRegularExpression property to define a regular expression that checks passwords to ensure that they:

  • Are longer than seven characters.
  • Contain at least one digit.
  • Contain at least one special (nonalphanumeric) character.

If the password entered by the user does not meet these criteria, the text contained in the PasswordRegularExpressionErrorMessage property is displayed to the user.

passwordregularexpression='@\"(?=.{7,})(?=(.*d){1,})(?=(.*W){1,})'

LINKs


http://www.regular-expressions.info/http://www.4guysfromrolla.com/webtech/120400-1.shtmlÂ

Deixe um comentário

O seu endereço de email não será publicado. Campos obrigatórios marcados com *