ProfileProviderCollection.Add(ProviderBase) 方法

定义

将一个配置文件提供程序添加到该集合中。Adds a profile provider to the collection.

public:
 override void Add(System::Configuration::Provider::ProviderBase ^ provider);
public override void Add (System.Configuration.Provider.ProviderBase provider);
override this.Add : System.Configuration.Provider.ProviderBase -> unit
Public Overrides Sub Add (provider As ProviderBase)

参数

provider
ProviderBase

要添加到该集合中的配置文件提供程序。The profile provider to add to the collection.

例外

providernullprovider is null.

provider 的类型不是继承 ProfileProvider 抽象类的类型。provider is not of a type that inherits the ProfileProvider abstract class.

注解

此方法不适于在您的代码中使用。This method is not intended to be used from your code.

配置文件提供程序实例将使用配置文件 ProfileProviderCollection 配置元素的profile (ASP.NET Settings Schema) 部分的 provider 元素添加到应用程序的。Profile provider instances are added to the ProfileProviderCollection for an application using the providers Element for profile (ASP.NET Settings Schema) section of the profile configuration element. 可以使用类的属性访问配置文件提供程序集合 Providers ProfileManagerYou can access the profile provider collection using the Providers property of the ProfileManager class.

适用于