Share via


SimpleMembershipProvider.UnlockUser Method

Unlocks a user account so that the membership user can be validated.

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

Syntax

'Declaration
Public Overrides Function UnlockUser ( _
    userName As String _
) As Boolean
'Usage
Dim instance As SimpleMembershipProvider 
Dim userName As String 
Dim returnValue As Boolean 

returnValue = instance.UnlockUser(userName)
public override bool UnlockUser(
    string userName
)
public:
virtual bool UnlockUser(
    String^ userName
) override
abstract UnlockUser : 
        userName:string -> bool  
override UnlockUser : 
        userName:string -> bool
public override function UnlockUser(
    userName : String
) : boolean

Parameters

  • userName
    Type: System.String
    The user whose user account you want to unlock.

Return Value

Type: System.Boolean
true if the user account was unlocked; otherwise, false.

Remarks

The UnlockUser(String) method will unlock a user account that was locked because too many failed password attempts were entered.

Note

If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection() method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

See Also

Reference

SimpleMembershipProvider Class

WebMatrix.WebData Namespace