ProfileSettingsCollection.Insert(Int32, ProfileSettings) メソッド

定義

指定した ProfileSettings オブジェクトをコレクション内の指定したインデックス位置に挿入します。

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)

パラメーター

index
Int32

コレクション内の ProfileSettings オブジェクトのインデックス。

authorizationSettings
ProfileSettings

コレクションに挿入する ProfileSettings オブジェクト。

例外

追加する ProfileSettings オブジェクトが既にコレクションに存在しているか、インデックスが無効であるか、コレクションが読み取り専用です。

次のコード例は、 Insert メソッドの使用方法を示しています。 このコード例は、 HealthMonitoringSection クラスに提供されるより大きな例の一部です。

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

注釈

index パラメーターがコレクション内の項目の数と等しい場合、エントリはコレクションの末尾に追加されます。

適用対象

こちらもご覧ください