ProfileSettingsCollection.Add(ProfileSettings) Methode

Definition

Fügt der Auflistung ein ProfileSettings Objekt hinzu.

public:
 void Add(System::Web::Configuration::ProfileSettings ^ profilesSettings);
public void Add(System.Web.Configuration.ProfileSettings profilesSettings);
member this.Add : System.Web.Configuration.ProfileSettings -> unit
Public Sub Add (profilesSettings As ProfileSettings)

Parameter

profilesSettings
ProfileSettings

Ein ProfileSettings Objekt, das der Auflistung hinzugefügt werden soll.

Ausnahmen

Das ProfileSettings hinzuzufügende Objekt ist bereits in der Auflistung vorhanden, oder die Auflistung ist schreibgeschützt.

Beispiele

Das folgende Codebeispiel zeigt, wie die Add Methode verwendet wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die HealthMonitoringSection Klasse bereitgestellt wird.


// Get the current Enabled property value.
Boolean enabledValue = healthMonitoringSection.Enabled;

// Set the Enabled property to false.
healthMonitoringSection.Enabled = false;

' Get the current Enabled property value.
Dim enabledValue As Boolean = healthMonitoringSection.Enabled

' Set the Enabled property to False.
healthMonitoringSection.Enabled = False

Hinweise

Die Auflistung darf noch kein Objekt mit demselben Namen enthalten ProfileSettings .

Gilt für:

Weitere Informationen