HttpStaticObjectsCollection.CopyTo Method

Copies members of an HttpStaticObjectsCollection into an array.

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

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
)
Not applicable.

Parameters

array

The array to copy the HttpStaticObjectsCollection into.

index

The member of the collection where copying starts.

The following example creates a new Object array of the required size and copies an existing StaticObjects collection into it.

No code example is currently available or this language may not be supported.
// 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)


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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: