Rediger

Del via


MembershipUser Constructors

Definition

Creates a new membership user object with the specified property values.

Overloads

MembershipUser()

Creates a new instance of a MembershipUser object for a class that inherits the MembershipUser class.

MembershipUser(String, String, Object, String, String, String, Boolean, Boolean, DateTime, DateTime, DateTime, DateTime, DateTime)

Creates a new membership user object with the specified property values.

MembershipUser()

Creates a new instance of a MembershipUser object for a class that inherits the MembershipUser class.

protected:
 MembershipUser();
protected MembershipUser ();
Protected Sub New ()

Remarks

The MembershipUser constructor is not intended to be used from your code.

See also

Applies to

MembershipUser(String, String, Object, String, String, String, Boolean, Boolean, DateTime, DateTime, DateTime, DateTime, DateTime)

Creates a new membership user object with the specified property values.

public:
 MembershipUser(System::String ^ providerName, System::String ^ name, System::Object ^ providerUserKey, System::String ^ email, System::String ^ passwordQuestion, System::String ^ comment, bool isApproved, bool isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate);
public MembershipUser (string providerName, string name, object providerUserKey, string email, string passwordQuestion, string comment, bool isApproved, bool isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate);
new System.Web.Security.MembershipUser : string * string * obj * string * string * string * bool * bool * DateTime * DateTime * DateTime * DateTime * DateTime -> System.Web.Security.MembershipUser
Public Sub New (providerName As String, name As String, providerUserKey As Object, email As String, passwordQuestion As String, comment As String, isApproved As Boolean, isLockedOut As Boolean, creationDate As DateTime, lastLoginDate As DateTime, lastActivityDate As DateTime, lastPasswordChangedDate As DateTime, lastLockoutDate As DateTime)

Parameters

providerName
String

The ProviderName string for the membership user.

name
String

The UserName string for the membership user.

providerUserKey
Object

The ProviderUserKey identifier for the membership user.

email
String

The Email string for the membership user.

passwordQuestion
String

The PasswordQuestion string for the membership user.

comment
String

The Comment string for the membership user.

isApproved
Boolean

The IsApproved value for the membership user.

isLockedOut
Boolean

true to lock out the membership user; otherwise, false.

creationDate
DateTime

The CreationDateDateTime object for the membership user.

lastLoginDate
DateTime

The LastLoginDateDateTime object for the membership user.

lastActivityDate
DateTime

The LastActivityDateDateTime object for the membership user.

lastPasswordChangedDate
DateTime

The LastPasswordChangedDateDateTime object for the membership user.

lastLockoutDate
DateTime

The LastLockoutDateDateTime object for the membership user.

Exceptions

providerName is null.

-or-

providerName is not found in the Providers collection.

The constructor is not available. This can occur if the application targets the .NET Framework 4 Client Profile. To prevent this exception, derive your class from the type and then call the default protected constructor, or change the application to target the full version of the .NET Framework.

Remarks

Creating a new MembershipUser object does not add a new membership user object to the membership data store. To add a new membership user to the membership data store, use the CreateUser method. Note that the CreateUser method returns a MembershipUser object for the membership user added to the data store.

MembershipUser objects can be constructed in application code for use with the UpdateUser method. Alternatively, you can also pass a MembershipUser object returned from the CreateUser, GetUser, GetAllUsers, FindUsersByName, or FindUsersByEmail method to the UpdateUser method as well.

MembershipUser objects are also commonly constructed by membership-provider implementations for the CreateUser, GetUser, GetAllUsers, FindUsersByName, and FindUsersByEmail methods.

The name, email, and passwordQuestion parameters are all trimmed before being used.

See also

Applies to