編輯

共用方式為


ProviderCollection.Add(ProviderBase) Method

Definition

Adds a provider to the collection.

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

Parameters

provider
ProviderBase

The provider to be added.

Exceptions

The collection is read-only.

provider is null.

The Name of provider is null.

-or-

The length of the Name of provider is less than 1.

Remarks

The Add method first checks for any exceptions (as listed in the Exceptions section), and then calls the Hashtable.Add method. It passes in the object referenced by the provider parameter as well as the Name property of the provider to be used as the key in the Hashtable object.

Applies to