Freigeben über


ServiceDescriptionCollection.CopyTo-Methode

Kopiert die gesamte ServiceDescriptionCollection in ein eindimensionales Array vom Typ ServiceDescription, beginnend am angegebenen nullbasierten Index des Zielarrays.

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

Syntax

'Declaration
Public Sub CopyTo ( _
    array As ServiceDescription(), _
    index As Integer _
)
'Usage
Dim instance As ServiceDescriptionCollection
Dim array As ServiceDescription()
Dim index As Integer

instance.CopyTo(array, index)
public void CopyTo (
    ServiceDescription[] array,
    int index
)
public:
void CopyTo (
    array<ServiceDescription^>^ array, 
    int index
)
public void CopyTo (
    ServiceDescription[] array, 
    int index
)
public function CopyTo (
    array : ServiceDescription[], 
    index : int
)

Parameter

  • array
    Ein Array vom Typ ServiceDescription, das als Ziel für den Kopiervorgang fungiert.
  • index
    Der nullbasierte Index, an dem mit dem Platzieren der kopierten Auflistung begonnen werden soll.

Beispiel

Dim myArray(myCollection.Count -1 ) As ServiceDescription
' Copy the collection to a 'ServiceDescription' array.
myCollection.CopyTo(myArray, 0)
Dim i As Integer
For i = 0 To myArray.Length - 1
   Console.WriteLine("Name of element in array: " + myArray(i).Name)
Next i
ServiceDescription[] myArray = new ServiceDescription[myCollection.Count];
// Copy the collection to a 'ServiceDescription' array.
myCollection.CopyTo(myArray,0);
for(int i=0; i<myArray.Length; i++)
{
   Console.WriteLine("Name of element in array: " +  myArray[i].Name);
}
array<ServiceDescription^>^myArray = gcnew array<ServiceDescription^>(myCollection->Count);

// Copy the collection to a ServiceDescription array.
myCollection->CopyTo( myArray, 0 );
for ( int i = 0; i < myArray->Length; i++ )
   Console::WriteLine( "Name of element in array: {0}", myArray[ i ]->Name );
ServiceDescription myArray[] = 
    new ServiceDescription[myCollection.get_Count()];

// Copy the collection to a 'ServiceDescription' array.
myCollection.CopyTo(myArray, 0);
for (int i = 0; i < myArray.length; i++) {
    Console.WriteLine("Name of element in array: " 
        + myArray[i].get_Name());
}
ServiceDescription myArray[] = 
    new ServiceDescription[myCollection.get_Count()];

// Copy the collection to a ServiceDescription array.
myCollection.CopyTo(myArray, 0);
for (int i = 0; i < myArray.length; i++) {
    Console.WriteLine("Name of element in array: " 
        + myArray[i].get_Name());
}

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ServiceDescriptionCollection-Klasse
ServiceDescriptionCollection-Member
System.Web.Services.Description-Namespace