語言

ProfileInfoCollection.Add(ProfileInfo) 方法

定義

將指定的 ProfileInfo 物件加入集合中。

public:
 void Add(System::Web::Profile::ProfileInfo ^ profileInfo);
public void Add(System.Web.Profile.ProfileInfo profileInfo);
member this.Add : System.Web.Profile.ProfileInfo -> unit
Public Sub Add (profileInfo As ProfileInfo)

參數

profileInfo
ProfileInfo

一個 ProfileInfo 要加入收藏的物件。

例外狀況

本合集為唯讀。

ProfileInfo集合中存在與值相同的UserNameprofileInfo物件。

profileInfo 是 null。

-或-

UserName 的 profileInfo 屬性是 null。

範例

關於在資料庫中建立ProfileProvider使用者設定檔的實作範例ProfileInfoCollection,請參見「實作設定檔提供者」。

備註

此Add方法常被設定提供者實作者用來填充 a ProfileInfoCollection 以從抽象類別的 GetAllProfiles 、 GetAllInactiveProfiles、 FindProfilesByUserName或 FindInactiveProfilesByUserName 方法回傳ProfileProvider。

適用於

另請參閱