ProfileSettingsCollection.Insert(Int32, ProfileSettings) Método

Definición

Inserta el objeto especificado ProfileSettings en el índice especificado de la colección.

public:
 void Insert(int index, System::Web::Configuration::ProfileSettings ^ authorizationSettings);
public void Insert(int index, System.Web.Configuration.ProfileSettings authorizationSettings);
member this.Insert : int * System.Web.Configuration.ProfileSettings -> unit
Public Sub Insert (index As Integer, authorizationSettings As ProfileSettings)

Parámetros

index
Int32

Índice de un ProfileSettings objeto de la colección.

authorizationSettings
ProfileSettings

Objeto ProfileSettings que se va a insertar en la colección.

Excepciones

El ProfileSettings objeto que se va a agregar ya existe en la colección, el índice no es válido o la colección es de solo lectura.

Ejemplos

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

// Insert an ProfileSettings object into the Profiles collection property.
healthMonitoringSection.Profiles.Insert(1, new ProfileSettings("Default2"));
' Insert an ProfileSettings object into the Profiles collection property.
healthMonitoringSection.Profiles.Insert(1, new ProfileSettings("Default2"))

Comentarios

Si el index parámetro es igual al número de elementos de la colección, la entrada se anexa al final de la colección.

Se aplica a

Consulte también