Partilhar via


ProfileSettingsCollection.Add(ProfileSettings) Método

Definição

Adiciona um objeto de ProfileSettings à 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 objeto ProfileSettings a ser adicionado à coleção.

Exceções

O objeto ProfileSettings a ser adicionado já existe na coleção ou a coleção é somente leitura.

Exemplos

O exemplo de código a seguir mostra como usar o método Add. 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

Comentários

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

Aplica-se a

Confira também