ImportCollection.CopyTo Method (Import(), Int32)

 

Copies the entire ImportCollection to a compatible one-dimensional array of type Import, 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 Import(),
	index As Integer
)

Parameters

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

An array of type Import serving as the destination of the copy action.

index
Type: System.Int32

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

The following example demonstrates the use of the CopyTo method.

Dim myImports(myServiceDescription.Imports.Count - 1) As Import
' Copy 'ImportCollection' to an array.
myServiceDescription.Imports.CopyTo(myImports, 0)
Console.WriteLine("Imports that are copied to Importarray ...")
Dim j As Integer
For j = 0 To myImports.Length - 1
   Console.WriteLine(ControlChars.Tab + _
                     "Import Namespace :{0} Import Location :{1} ", _
                     myImports(j).Namespace, myImports(j).Location)
Next j

.NET Framework
Available since 1.1
Return to top
Show: