Export (0) Print
Expand All

MembershipProvider.PasswordAttemptWindow Property

Gets the number of minutes in which a maximum number of invalid password or password-answer attempts are allowed before the membership user is locked out.

Namespace:  System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

public abstract int PasswordAttemptWindow { get; }

Property Value

Type: System.Int32
The number of minutes in which a maximum number of invalid password or password-answer attempts are allowed before the membership user is locked out.

The PasswordAttemptWindow property works in conjunction with the MaxInvalidPasswordAttempts property to guard against an unwanted source guessing the password or password answer of a membership user through repeated attempts. If the number of invalid passwords or password questions supplied for a membership user exceeds the MaxInvalidPasswordAttempts within the number of minutes identified by the PasswordAttemptWindow, then the membership user is locked out by setting the IsLockedOut property to true until the user is unlocked by a call to the UnlockUser method. If a valid password or password answer is supplied before the MaxInvalidPasswordAttempts is reached, the counter that tracks the number of invalid attempts is reset to zero.

Invalid password and password-answer attempts accumulate independently of one another. For example, if the MaxInvalidPasswordAttempts property is set to 5, and three invalid password attempts are made followed by two invalid password-answer attempts, two more invalid password attempts (or three more invalid password-answer attempts) must be made within the PasswordAttemptWindow value for the membership user to be locked out.

If the RequiresQuestionAndAnswer property is set to false, invalid password-answer attempts are not tracked.

Invalid password and password-answer attempts are tracked in the ValidateUser, ChangePassword, ChangePasswordQuestionAndAnswer, GetPassword, and ResetPassword methods.

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft