PortTypeCollection.CopyTo-Methode
Kopiert die gesamte PortTypeCollection in ein eindimensionales Array vom Typ PortType, wobei am angegebenen nullbasierten Index des Zielarrays begonnen wird.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Syntax
'Declaration
Public Sub CopyTo ( _
array As PortType(), _
index As Integer _
)
'Usage
Dim instance As PortTypeCollection
Dim array As PortType()
Dim index As Integer
instance.CopyTo(array, index)
public void CopyTo (
PortType[] array,
int index
)
public:
void CopyTo (
array<PortType^>^ array,
int index
)
public void CopyTo (
PortType[] array,
int index
)
public function CopyTo (
array : PortType[],
index : int
)
Parameter
- array
Ein Array vom Typ PortType, das als Ziel des Kopiervorgangs fungiert.
- index
Der nullbasierte Index, an dem mit dem Platzieren der kopierten Auflistung begonnen werden soll.
Beispiel
Dim myPortTypeCollection As PortTypeCollection
Dim myServiceDescription As ServiceDescription = _
ServiceDescription.Read("MathService_VB.wsdl")
myPortTypeCollection = myServiceDescription.PortTypes
Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count
Console.WriteLine( _
ControlChars.NewLine + "Total number of PortTypes: " & _
myServiceDescription.PortTypes.Count.ToString())
' Copy the collection into an array.
Dim myPortTypeArray(noOfPortTypes-1) As PortType
myPortTypeCollection.CopyTo(myPortTypeArray, 0)
' Display names of all PortTypes.
Dim i As Integer
For i = 0 To noOfPortTypes - 1
Console.WriteLine("PortType Name: " + myPortTypeArray(i).Name)
Next i
myServiceDescription.Write("MathService_New.wsdl")
PortTypeCollection myPortTypeCollection;
ServiceDescription myServiceDescription =
ServiceDescription.Read("MathService_CS.wsdl");
myPortTypeCollection = myServiceDescription.PortTypes;
int noOfPortTypes = myServiceDescription.PortTypes.Count;
Console.WriteLine("\nTotal number of PortTypes: "
+ myServiceDescription.PortTypes.Count);
// Copy the collection into an array.
PortType[] myPortTypeArray = new PortType[noOfPortTypes];
myPortTypeCollection.CopyTo(myPortTypeArray, 0);
// Display names of all PortTypes.
for(int i = 0; i < noOfPortTypes; i++)
Console.WriteLine("PortType name: " + myPortTypeArray[i].Name);
myServiceDescription.Write("MathService_New.wsdl");
PortTypeCollection^ myPortTypeCollection;
ServiceDescription^ myServiceDescription =
ServiceDescription::Read( "MathService_CS.wsdl" );
myPortTypeCollection = myServiceDescription->PortTypes;
int noOfPortTypes = myServiceDescription->PortTypes->Count;
Console::WriteLine( "\nTotal number of PortTypes: {0}",
myServiceDescription->PortTypes->Count );
// Copy the collection into an array.
array<PortType^>^ myPortTypeArray = gcnew array<PortType^>(noOfPortTypes);
myPortTypeCollection->CopyTo( myPortTypeArray, 0 );
// Display names of all PortTypes.
for ( int i = 0; i < noOfPortTypes; i++ )
{
Console::WriteLine( "PortType name: {0}", myPortTypeArray[ i ]->Name );
}
myServiceDescription->Write( "MathService_New.wsdl" );
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
PortTypeCollection-Klasse
PortTypeCollection-Member
System.Web.Services.Description-Namespace