ActiveDirectoryMembershipUser Constructor (String, String, Object, String, String, String, Boolean, Boolean, DateTime, DateTime, DateTime, DateTime, DateTime)
Creates a new instance of the ActiveDirectoryMembershipUser class with the specified property values.
Assembly: System.Web (in System.Web.dll)
public ActiveDirectoryMembershipUser( 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 )
Parameters
- providerName
- Type: System.String
The ProviderName for the membership user.
- name
- Type: System.String
The UserName for the membership user.
- providerUserKey
- Type: System.Object
The ProviderUserKey for the membership user.
- Type: System.String
The Email address of the membership user.
- passwordQuestion
- Type: System.String
The PasswordQuestion for the membership user.
- comment
- Type: System.String
The Comment for the membership user.
- isApproved
- Type: System.Boolean
The IsApproved value for the membership user.
- isLockedOut
- Type: System.Boolean
The IsLockedOut value for the membership user.
- creationDate
- Type: System.DateTime
The CreationDate for the membership user.
- lastLoginDate
- Type: System.DateTime
The LastLoginDate for the membership user. This parameter is not used.
- lastActivityDate
- Type: System.DateTime
The LastActivityDate for the membership user. This parameter is not used.
- lastPasswordChangedDate
- Type: System.DateTime
The LastPasswordChangedDate for the membership user.
- lastLockoutDate
- Type: System.DateTime
The LastLockoutDate for the membership user.
| Exception | Condition |
|---|---|
| ArgumentException | providerUserKey is not a SecurityIdentifier object. - or - providerName is null and a provider is not set in the application's configuration file. |
Creating a new ActiveDirectoryMembershipUser 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 an ActiveDirectoryMembershipUser object for the membership user added to the data store.
ActiveDirectoryMembershipUser objects are commonly constructed in application code for use with the UpdateUser method, although you can also pass an ActiveDirectoryMembershipUser object returned from the CreateUser, GetUser, GetAllUsers, FindUsersByName, or FindUsersByEmail method to the UpdateUser method as well.
ActiveDirectoryMembershipUser objects are also commonly constructed by membership provider implementations for the CreateUser, GetUser, GetAllUsers, UpdateUser, FindUsersByName, and FindUsersByEmail methods.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.