SoapHeaderCollection.CopyTo(SoapHeader[], Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將 的 SoapHeaderCollection 元素複製到 Array,從 的 Array某個特定索引開始。
public:
void CopyTo(cli::array <System::Web::Services::Protocols::SoapHeader ^> ^ array, int index);
public void CopyTo(System.Web.Services.Protocols.SoapHeader[] array, int index);
member this.CopyTo : System.Web.Services.Protocols.SoapHeader[] * int -> unit
Public Sub CopyTo (array As SoapHeader(), index As Integer)
參數
- array
- SoapHeader[]
一維 Array ,即從 中複製 SoapHeaderCollection元素的目的地。 陣列必須具有零基索引。
- index
- Int32
複製開始的參數中 array 以零為基礎的索引。
例外狀況
參數 array 為 null。
參數 index 小於零。
範例
mySoapHeaders = gcnew array<MySoapHeader^>(mySoapHeaderCollection->Count);
mySoapHeaderCollection->CopyTo( mySoapHeaders, 0 );
mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
mySoapHeaders = New MySoapHeader(mySoapHeaderCollection.Count-1) {}
mySoapHeaderCollection.CopyTo(mySoapHeaders, 0)