HttpStaticObjectsCollection.CopyTo Method
.NET Framework 3.0
Copies members of an HttpStaticObjectsCollection into an array.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
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.
// 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)
Community Additions
ADD
Show: