Freigeben über


HttpStaticObjectsCollection.CopyTo-Methode

Kopiert Member einer HttpStaticObjectsCollection in ein Array.

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

Syntax

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

instance.CopyTo(array, index)
public void CopyTo (
    Array array,
    int index
)
public:
virtual void CopyTo (
    Array^ array, 
    int index
) sealed
public final void CopyTo (
    Array array, 
    int index
)
public final function CopyTo (
    array : Array, 
    index : int
)

Parameter

  • index
    Der Member der Auflistung, bei dem mit dem Kopieren begonnen wird.

Beispiel

Im folgenden Beispiel wird ein neues Object-Array mit der erforderlichen Größe erstellt und eine vorhandene StaticObjects-Auflistung in dieses Array kopiert.

' Find the number of members in the StaticObjects collection.
Dim ObjCount As Integer = Application.StaticObjects.Count
' Create an array of the same size.
Dim MyObjArray(ObjCount) As Object
' Copy the entire collection into the array.
Application.StaticObjects.CopyTo(MyObjArray, 0)
// Find the number of members in the StaticObjects collection.
int ObjCount = Application.StaticObjects.Count;
// Create an array of the same size.
Object[] MyObjArray = new Object[ObjCount];
// Copy the entire collection into the array.
Application.StaticObjects.CopyTo(MyObjArray, 0);
// Find the number of members in the StaticObjects collection.
int objCount = get_Application().get_StaticObjects().get_Count();
// Create an array of the same size.
Array myObjArray =
    Array.CreateInstance(Type.GetType("System.Object"), objCount);
// Copy the entire collection into the array.
get_Application().get_StaticObjects().CopyTo(myObjArray,0);
// Find the number of members in the StaticObjects collection.
var objCount : int = Application.StaticObjects.Count
// Create an array of the same size.
var myObjArray : System.Array = System.Array.CreateInstance(System.Object, objCount)
// Copy the entire collection into the array.
Application.StaticObjects.CopyTo(myObjArray, 0)

Plattformen

Windows 98, Windows 2000 SP4, 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

HttpStaticObjectsCollection-Klasse
HttpStaticObjectsCollection-Member
System.Web-Namespace