ProfileSettingsCollection.Add(ProfileSettings) Metodo

Definizione

Aggiunge un ProfileSettings oggetto all'insieme.

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 all'insieme.

Eccezioni

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

Esempio

Nell'esempio di codice seguente viene illustrato come usare il Add metodo . 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 contenere già un ProfileSettings oggetto con lo stesso nome.

Si applica a

Vedi anche