Export (0) Print
Expand All

WebSecurity.IsAccountLockedOut Method (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.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public static function IsAccountLockedOut(
	userName : String, 
	allowedPasswordAttempts : int, 
	interval : TimeSpan
) : boolean

Parameters

userName
Type: System.String
The user name of the membership account.
allowedPasswordAttempts
Type: System.Int32
The number of password attempts the user is permitted before the membership account is locked.
interval
Type: System.TimeSpan
The number of seconds to lock out a user account after the number of password attempts exceeds the value in the allowedPasswordAttempts parameter.

Return Value

Type: System.Boolean
true if the membership account is locked; otherwise, false.

ExceptionCondition
InvalidOperationException

The SimpleMembershipProvider.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.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Show:
© 2014 Microsoft