ProfileSettingsCollection.Add(ProfileSettings) Metod

Definition

Lägger till ett ProfileSettings objekt i samlingen.

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)

Parametrar

profilesSettings
ProfileSettings

Ett ProfileSettings objekt som ska läggas till i samlingen.

Undantag

Objektet ProfileSettings som ska läggas till finns redan i samlingen, eller så är samlingen skrivskyddad.

Exempel

I följande kodexempel visas hur metoden Add används. Det här kodexemplet är en del av ett större exempel för HealthMonitoringSection klassen.


// 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

Kommentarer

Samlingen får inte redan innehålla ett ProfileSettings objekt med samma namn.

Gäller för

Se även