次の方法で共有


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 コレクション内の項目の数と等しい場合、エントリはコレクションの末尾に追加されます。

適用対象

こちらもご覧ください