ProfileSettingsCollection.Insert(Int32, ProfileSettings) Metod

Definition

Infogar det angivna ProfileSettings objektet vid det angivna indexet i samlingen.

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)

Parametrar

index
Int32

Indexet för ett ProfileSettings objekt i samlingen.

authorizationSettings
ProfileSettings

Ett ProfileSettings objekt som ska infogas i samlingen.

Undantag

Objektet ProfileSettings som ska läggas till finns redan i samlingen, indexet är ogiltigt eller samlingen är skrivskyddad.

Exempel

I följande kodexempel visas hur metoden Insert används. Det här kodexemplet är en del av ett större exempel för HealthMonitoringSection klassen.

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

Kommentarer

Om parametern index är lika med antalet objekt i samlingen läggs posten till i slutet av samlingen.

Gäller för

Se även