ProfileSettingsCollection.Add(ProfileSettings) Método

Definición

Agrega un ProfileSettings objeto a la colección.

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

Objeto ProfileSettings que se va a agregar a la colección.

Excepciones

El ProfileSettings objeto que se va a agregar ya existe en la colección o la colección es de solo lectura.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el Add método . Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la HealthMonitoringSection clase .


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

Comentarios

La colección aún no debe contener un ProfileSettings objeto con el mismo nombre.

Se aplica a

Consulte también