MembershipProvider Class

 

Defines the contract that ASP.NET implements to provide membership services using custom membership providers.

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


public ref class MembershipProvider abstract : ProviderBase

NameDescription
System_CAPS_protmethodMembershipProvider()

Initializes a new instance of the MembershipProvider class.

NameDescription
System_CAPS_pubpropertyApplicationName

The name of the application using the custom membership provider.

System_CAPS_pubpropertyDescription

Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).(Inherited from ProviderBase.)

System_CAPS_pubpropertyEnablePasswordReset

Indicates whether the membership provider is configured to allow users to reset their passwords.

System_CAPS_pubpropertyEnablePasswordRetrieval

Indicates whether the membership provider is configured to allow users to retrieve their passwords.

System_CAPS_pubpropertyMaxInvalidPasswordAttempts

Gets the number of invalid password or password-answer attempts allowed before the membership user is locked out.

System_CAPS_pubpropertyMinRequiredNonAlphanumericCharacters

Gets the minimum number of special characters that must be present in a valid password.

System_CAPS_pubpropertyMinRequiredPasswordLength

Gets the minimum length required for a password.

System_CAPS_pubpropertyName

Gets the friendly name used to refer to the provider during configuration.(Inherited from ProviderBase.)

System_CAPS_pubpropertyPasswordAttemptWindow

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.

System_CAPS_pubpropertyPasswordFormat

Gets a value indicating the format for storing passwords in the membership data store.

System_CAPS_pubpropertyPasswordStrengthRegularExpression

Gets the regular expression used to evaluate a password.

System_CAPS_pubpropertyRequiresQuestionAndAnswer

Gets a value indicating whether the membership provider is configured to require the user to answer a password question for password reset and retrieval.

System_CAPS_pubpropertyRequiresUniqueEmail

Gets a value indicating whether the membership provider is configured to require a unique e-mail address for each user name.

NameDescription
System_CAPS_pubmethodChangePassword(String^, String^, String^)

Processes a request to update the password for a membership user.

System_CAPS_pubmethodChangePasswordQuestionAndAnswer(String^, String^, String^, String^)

Processes a request to update the password question and answer for a membership user.

System_CAPS_pubmethodCreateUser(String^, String^, String^, String^, String^, Boolean, Object^, MembershipCreateStatus%)

Adds a new membership user to the data source.

System_CAPS_protmethodDecryptPassword(array<Byte>^)

Decrypts an encrypted password.

System_CAPS_pubmethodDeleteUser(String^, Boolean)

Removes a user from the membership data source.

System_CAPS_protmethodEncryptPassword(array<Byte>^)

Encrypts a password.

System_CAPS_protmethodEncryptPassword(array<Byte>^, MembershipPasswordCompatibilityMode)

Encrypts the specified password using the specified password-compatibility mode.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFindUsersByEmail(String^, Int32, Int32, Int32%)

Gets a collection of membership users where the e-mail address contains the specified e-mail address to match.

System_CAPS_pubmethodFindUsersByName(String^, Int32, Int32, Int32%)

Gets a collection of membership users where the user name contains the specified user name to match.

System_CAPS_pubmethodGetAllUsers(Int32, Int32, Int32%)

Gets a collection of all the users in the data source in pages of data.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetNumberOfUsersOnline()

Gets the number of users currently accessing the application.

System_CAPS_pubmethodGetPassword(String^, String^)

Gets the password for the specified user name from the data source.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetUser(Object^, Boolean)

Gets user information from the data source based on the unique identifier for the membership user. Provides an option to update the last-activity date/time stamp for the user.

System_CAPS_pubmethodGetUser(String^, Boolean)

Gets information from the data source for a user. Provides an option to update the last-activity date/time stamp for the user.

System_CAPS_pubmethodGetUserNameByEmail(String^)

Gets the user name associated with the specified e-mail address.

System_CAPS_pubmethodInitialize(String^, NameValueCollection^)

Initializes the provider.(Inherited from ProviderBase.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnValidatingPassword(ValidatePasswordEventArgs^)

Raises the ValidatingPassword event if an event handler has been defined.

System_CAPS_pubmethodResetPassword(String^, String^)

Resets a user's password to a new, automatically generated password.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodUnlockUser(String^)

Clears a lock so that the membership user can be validated.

System_CAPS_pubmethodUpdateUser(MembershipUser^)

Updates information about a user in the data source.

System_CAPS_pubmethodValidateUser(String^, String^)

Verifies that the specified user name and password exist in the data source.

NameDescription
System_CAPS_pubeventValidatingPassword

Occurs when a user is created, a password is changed, or a password is reset.

ASP.NET membership is designed to enable you to easily use a number of different membership providers for your ASP.NET applications. You can use the supplied membership providers that are included with the .NET Framework, or you can implement your own provider.

System_CAPS_noteNote

If you are not familiar with the membership features of ASP.NET, see Introduction to Membership before continuing. For a list of other topics related to membership, see Managing Users by Using Membership.

When implementing a custom membership provider, you are required to inherit the MembershipProvider abstract class.

There are two primary reasons for creating a custom membership provider.

  • You need to store membership information in a data source that is not supported by the membership providers included with the .NET Framework, such as a FoxPro database, an Oracle database, or other data source.

  • You need to manage membership information using a database schema that is different from the database schema used by the providers that ship with the .NET Framework. A common example of this would be membership data that already exists in a SQL Server database for a company or Web site.

The MembershipProvider abstract class inherits from the ProviderBase abstract class. MembershipProvider implementations must also implement the required members of ProviderBase.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: