ProfileSettingsCollection.Insert(Int32, ProfileSettings) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
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.