PortCollection.CopyTo Method (Port(), Int32)

 

Copies the entire PortCollection to a one-dimensional array of type Port, starting at the specified zero-based index of the target array.

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

Public Sub CopyTo (
	array As Port(),
	index As Integer
)

Parameters

array
Type: System.Web.Services.Description.Port()

An array of type Port serving as the destination for the copy action.

index
Type: System.Int32

The zero-based index at which to start placing the copied collection.

myPortCollection = myService.Ports

' Create an array of Port objects.
Console.WriteLine(ControlChars.NewLine & "Port collection :")
Dim myPortArray(myService.Ports.Count) As Port
myPortCollection.CopyTo(myPortArray, 0)
Dim i1 As Integer
For i1 = 0 to myService.Ports.Count -1
   Console.WriteLine("Port[" & i1.ToString + "] : " & _
      myPortArray(i1).Name)
Next

.NET Framework
Available since 1.1
Return to top
Show: