ProfileSettingsCollection.Insert(Int32, ProfileSettings) Méthode

Définition

Insère l’objet spécifié ProfileSettings à l’index spécifié dans la collection.

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)

Paramètres

index
Int32

Index d’un ProfileSettings objet dans la collection.

authorizationSettings
ProfileSettings

Objet ProfileSettings à insérer dans la collection.

Exceptions

L’objet ProfileSettings à ajouter existe déjà dans la collection, l’index n’est pas valide ou la collection est en lecture seule.

Exemples

L’exemple de code suivant montre comment utiliser la Insert méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la HealthMonitoringSection classe.

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

Remarques

Si le index paramètre est égal au nombre d’éléments de la collection, l’entrée est ajoutée à la fin de la collection.

S’applique à

Voir aussi