WebSecurity.IsAccountLockedOut Method

Definition

Overloads

IsAccountLockedOut(String, Int32, Int32)

Returns a value that indicates whether the specified membership account is temporarily locked because of too many failed password attempts in the specified number of seconds.

IsAccountLockedOut(String, Int32, TimeSpan)

Returns a value that indicates whether the specified membership account is temporarily locked because of too many failed password attempts in the specified time span.

IsAccountLockedOut(String, Int32, Int32)

Returns a value that indicates whether the specified membership account is temporarily locked because of too many failed password attempts in the specified number of seconds.

public static bool IsAccountLockedOut (string userName, int allowedPasswordAttempts, int intervalInSeconds);
static member IsAccountLockedOut : string * int * int -> bool
Public Shared Function IsAccountLockedOut (userName As String, allowedPasswordAttempts As Integer, intervalInSeconds As Integer) As Boolean

Parameters

userName
String

The user name of the membership account.

allowedPasswordAttempts
Int32

The number of password attempts the user is permitted before the membership account is locked.

intervalInSeconds
Int32

The number of seconds to lock a user account after the number of password attempts exceeds the value in the allowedPasswordAttempts parameter.

Returns

Boolean

true if the membership account is locked; otherwise, false.

Exceptions

The Initialize(String, NameValueCollection) method was not called.-or-The InitializeDatabaseConnection method was not called.-or-The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.

Applies to

IsAccountLockedOut(String, Int32, TimeSpan)

Returns a value that indicates whether the specified membership account is temporarily locked because of too many failed password attempts in the specified time span.

public static bool IsAccountLockedOut (string userName, int allowedPasswordAttempts, TimeSpan interval);
static member IsAccountLockedOut : string * int * TimeSpan -> bool
Public Shared Function IsAccountLockedOut (userName As String, allowedPasswordAttempts As Integer, interval As TimeSpan) As Boolean

Parameters

userName
String

The user name of the membership account.

allowedPasswordAttempts
Int32

The number of password attempts the user is permitted before the membership account is locked.

interval
TimeSpan

The number of seconds to lock out a user account after the number of password attempts exceeds the value in the allowedPasswordAttempts parameter.

Returns

Boolean

true if the membership account is locked; otherwise, false.

Exceptions

The Initialize(String, NameValueCollection) method was not called.-or-The InitializeDatabaseConnection method was not called.-or-The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.

Applies to