ProfileInfoCollection.Add(ProfileInfo) ProfileInfoCollection.Add(ProfileInfo) ProfileInfoCollection.Add(ProfileInfo) Method

定义

将指定的 ProfileInfo 对象添加到集合。Adds the specified ProfileInfo object to the collection.

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

参数

profileInfo
ProfileInfo ProfileInfo ProfileInfo

要添加到集合的 ProfileInfo 对象。A ProfileInfo object to add to the collection.

异常

该集合是只读的。The collection is read-only.

集合中已经存在一个与 profileInfo 具有相同的 ProfileInfo 值的 UserName 对象。A ProfileInfo object with the same UserName value as profileInfo already exists in the collection.

profileInfonullprofileInfo is null.

-or- profileInfoUserName 属性为 nullThe UserName property of profileInfo is null.

示例

有关为数据存储区ProfileProviderProfileInfoCollection的用户配置文件创建的实现的示例, 请参阅实现配置文件提供程序For an example of a ProfileProvider implementation that creates a ProfileInfoCollection for user profiles in a data store, see Implementing a Profile Provider.

注解

GetAllInactiveProfiles FindInactiveProfilesByUserName ProfileProvider ProfileInfoCollection FindProfilesByUserName配置文件提供程序实现者通常使用GetAllProfiles方法来填充从抽象类的、、或方法返回的。 AddThe Add method is commonly used by profile-provider implementers to populate a ProfileInfoCollection to return from the GetAllProfiles, GetAllInactiveProfiles, FindProfilesByUserName, or FindInactiveProfilesByUserName method of the ProfileProvider abstract class.

适用于

另请参阅