Share via


SoapHeaderCollection.Insert(Int32, SoapHeader) メソッド

定義

SoapHeader 内の指定したインデックス位置に、SoapHeaderCollection を挿入します。

public:
 void Insert(int index, System::Web::Services::Protocols::SoapHeader ^ header);
public void Insert (int index, System.Web.Services.Protocols.SoapHeader header);
member this.Insert : int * System.Web.Services.Protocols.SoapHeader -> unit
Public Sub Insert (index As Integer, header As SoapHeader)

パラメーター

index
Int32

SoapHeaderSoapHeaderCollection に挿入する位置の、0 から始まるインデックス番号。

header
SoapHeader

SoapHeaderCollection に挿入する SoapHeader

例外

index パラメーターが SoapHeaderCollection 内の有効なインデックスではありません。

mySoapHeader = gcnew MySoapHeader;
mySoapHeader->text = "This header is inserted before the first header";
mySoapHeaderCollection->Insert( 0, mySoapHeader );
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This header is inserted before the first header";
mySoapHeaderCollection.Insert(0, mySoapHeader);
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This header is inserted before the first header"
mySoapHeaderCollection.Insert(0, mySoapHeader)

注釈

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

挿入ポイントの後の要素は SoapHeader 、新しい要素に合わせて下に移動します。

適用対象

こちらもご覧ください