SoapHeaderCollection.CopyTo Method

Copies the elements of the SoapHeaderCollection to an Array, starting at a particular index of the Array.

Namespace: System.Web.Services.Protocols
Assembly: System.Web.Services (in system.web.services.dll)

public:
void CopyTo (
	array<SoapHeader^>^ array, 
	int index
)
public void CopyTo (
	SoapHeader[] array, 
	int index
)
public function CopyTo (
	array : SoapHeader[], 
	index : int
)
Not applicable.

Parameters

array

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

index

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

Exception typeCondition

ArgumentNullException

The array parameter is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The index parameter is less than zero.

ArgumentException

The array parameter is multidimensional.

-or-

The index parameter is equal to or greater than the length of array.

-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.

mySoapHeaders = gcnew array<MySoapHeader^>(mySoapHeaderCollection->Count);
mySoapHeaderCollection->CopyTo( mySoapHeaders, 0 );

mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.get_Count()];
mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show: