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对象。

profileInfonull

-或-

UserNameprofileInfo 属性 null

示例

有关在数据存储中创建用户配置文件的实现ProfileProvider示例ProfileInfoCollection,请参阅“实现配置文件提供程序”。

注解

配置文件Add提供程序实现程序通常使用该方法来填充ProfileInfoCollection抽象类的GetAllProfilesGetAllInactiveProfiles返回值或FindProfilesByUserNameFindInactiveProfilesByUserNameProfileProvider方法。

适用于

另请参阅