SoapHeaderCollection.Insert(Int32, SoapHeader) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定的索引處插入 a SoapHeaderSoapHeaderCollection 。
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的零基索引。
- header
- 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 元素會向下移動以容納新元素。