ProfileSettingsCollection.Add(ProfileSettings) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
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.