Muokkaa

Jaa


SoapHeaderCollection.CopyTo(SoapHeader[], Int32) Method

Definition

Copies the elements of the SoapHeaderCollection to an Array, starting at a particular index of the 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)

Parameters

array
SoapHeader[]

The one-dimensional Array that is the destination of the elements copied from SoapHeaderCollection. The array must have zero-based indexing.

index
Int32

The zero-based index in the array parameter at which copying begins.

Exceptions

The array parameter is null.

The index parameter is less than zero.

The array parameter is multidimensional.

-or-

The number of elements in the source SoapHeaderCollection is greater than the available space from the index parameter to the end of the destination array.

Examples

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)

Applies to

See also