次の方法で共有


SoapHeaderCollection.Insert メソッド

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

Public Sub Insert( _
   ByVal index As Integer, _   ByVal header As SoapHeader _)
[C#]
public void Insert(intindex,SoapHeaderheader);
[C++]
public: void Insert(intindex,SoapHeader* header);
[JScript]
public function Insert(
   index : int,header : SoapHeader);

パラメータ

例外

例外の種類 条件
ArgumentOutOfRangeException index パラメータが、 SoapHeaderCollection の有効なインデックスではありません。

解説

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

新しい要素を挿入するために、挿入位置より後にある SoapHeader 要素の位置が繰り下げられます。

使用例

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

[C#] 
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This header is inserted before the first header";
mySoapHeaderCollection.Insert(0, mySoapHeader);

[C++] 
mySoapHeader = new MySoapHeader();
mySoapHeader->text = S"This header is inserted before the first header";
mySoapHeaderCollection->Insert(0, mySoapHeader);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

SoapHeaderCollection クラス | SoapHeaderCollection メンバ | System.Web.Services.Protocols 名前空間 | Insert | IList | SoapHeader | CollectionBase