語言

MembershipUser 建構函式

定義

建立一個新的成員使用者物件,並設定指定的屬性值。

多載

名稱 Description
MembershipUser()

為繼承該MembershipUser類別建立一個新的物件實例MembershipUser。

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

建立一個新的成員使用者物件,並設定指定的屬性值。

MembershipUser()

為繼承該MembershipUser類別建立一個新的物件實例MembershipUser。

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

備註

MembershipUser建構子並非設計用來直接使用你的程式碼。

另請參閱

適用於

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

建立一個新的成員使用者物件,並設定指定的屬性值。

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)

參數

providerName
String

成員使用者的 ProviderName 字串。

name
String

成員使用者的 UserName 字串。

providerUserKey
Object

會員 ProviderUserKey 使用者的識別碼。

email
String

成員使用者的 Email 字串。

passwordQuestion
String

成員使用者的 PasswordQuestion 字串。

comment
String

成員使用者的 Comment 字串。

isApproved
Boolean

會員 IsApproved 用戶的價值。

isLockedOut
Boolean

true鎖定會員用戶;否則,。 false

creationDate
DateTime

會員使用者的 CreationDateDateTime 物件。

lastLoginDate
DateTime

會員使用者的 LastLoginDateDateTime 物件。

lastActivityDate
DateTime

會員使用者的 LastActivityDateDateTime 物件。

lastPasswordChangedDate
DateTime

會員使用者的 LastPasswordChangedDateDateTime 物件。

lastLockoutDate
DateTime

會員使用者的 LastLockoutDateDateTime 物件。

例外狀況

providerName 是 null。

-或-

providerName 未收錄於該 Providers 收藏中。

該建造者無法取得。 若應用程式針對 .NET Framework 4 用戶端設定檔,則可能發生這種情況。 為避免此例外,請從該類型衍生出類別,然後呼叫預設受保護的建構子,或將應用程式改為針對完整版本的 .NET 框架。

備註

建立新 MembershipUser 物件不會將新的成員使用者物件加入會員資料儲存庫。 若要將新的會員使用者加入會員資料儲存,請使用以下 CreateUser 方法。 請注意,該 CreateUser 方法會回傳 MembershipUser 一個加入資料儲存的成員使用者物件。

MembershipUser 物件可以在應用程式程式碼中建構,以便與該 UpdateUser 方法一起使用。 或者,你也可以將MembershipUser從 CreateUser、 GetUser、 GetAllUsersFindUsersByName或 FindUsersByEmail 方法回傳的物件傳給該UpdateUser方法。

MembershipUser物件也常由成員-提供者實作來構建,涵蓋 CreateUser、 GetUser、 GetAllUsersFindUsersByName、 FindUsersByEmail 和 方法。

name email passwordQuestion使用前,這些參數都會被修剪。

另請參閱

適用於