Share via


ProfileSettingsCollection.Add(ProfileSettings) Metodo

Definizione

Aggiunge un oggetto ProfileSettings alla raccolta.

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)

Parametri

profilesSettings
ProfileSettings

Oggetto ProfileSettings da aggiungere alla raccolta.

Eccezioni

L'oggetto ProfileSettings da aggiungere è già presente nell'insieme oppure l'insieme è in sola lettura.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare il metodo Add. Questo esempio di codice fa parte di un esempio più ampio fornito per la HealthMonitoringSection classe .


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

Commenti

L'insieme non deve già contenere un ProfileSettings oggetto con lo stesso nome.

Si applica a

Vedi anche