ProfileSettingsCollection.Add(ProfileSettings) Método

Definição

Adiciona um ProfileSettings objeto à coleção.

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)

Parâmetros

profilesSettings
ProfileSettings

Um ProfileSettings objeto para adicionar à coleção.

Exceções

O ProfileSettings objeto a adicionar já existe na coleção, ou a coleção é apenas de leitura.

Exemplos

O exemplo de código a seguir mostra como usar o Add método. Este exemplo de código faz parte de um exemplo maior fornecido para a 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

Observações

A coleção não deve já conter um ProfileSettings objeto com o mesmo nome.

Aplica-se a

Ver também