Share via


ProfileSettingsCollection.Insert(Int32, ProfileSettings) Metodo

Definizione

Inserisce l'oggetto ProfileSettings specificato in corrispondenza dell'indice specificato nell'insieme.

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)

Parametri

index
Int32

Indice di un oggetto ProfileSettings nell'insieme.

authorizationSettings
ProfileSettings

Oggetto ProfileSettings da inserire nell'insieme.

Eccezioni

L'oggetto ProfileSettings da aggiungere già esiste nell'insieme, l'indice non è valido o l'insieme è di sola lettura.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare il metodo Insert. Questo esempio di codice fa parte di un esempio più grande fornito per 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"))

Commenti

Se il index parametro è uguale al numero di elementi nell'insieme, la voce viene aggiunta alla fine della raccolta.

Si applica a

Vedi anche