ProfileSettingsCollection.Add(ProfileSettings) Método

Definición

Agrega un objeto ProfileSettings 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 objeto ProfileSettings que se va a agregar ya existe en la colección o la colección es de sólo lectura.

Ejemplos

En el ejemplo de código siguiente, se muestra cómo se utiliza el método Add. Este ejemplo de código es parte de un ejemplo mayor proporcionado para la clase HealthMonitoringSection.


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