System.Web Namespace HttpStaticObjectsCollection Class
Copies members of an HttpStaticObjectsCollection into an array.
[ VB ]
NotOverridable Public Sub CopyTo ( _
ByVal array As Array, _
ByVal index As Integer _
) Implements ICollection.CopyTo
[ C# ]
public void CopyTo (
Array array,
int index
);
[ C++ ]
public: __sealed void CopyTo (
Array* array,
int index
);
[ JScript ]
public function CopyTo (
array : Array,
index : int
);
- array
- The array to copy the HttpStaticObjectsCollection into.
- index
- The member of the collection where copying starts.
ICollection.CopyTo
The following example creates a new Object array of the required size and copies an existing StaticObjects collection into it.
[ VB ]
' 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 As Array = Array.CreateInstance ( Type.GetType ( "System.Object" ) , ObjCount )
' Copy the entire collection into the array.
Application.StaticObjects.CopyTo ( myObjArray, 0 )
[ C# ]
// Find the number of members in the StaticObjects collection.
int ObjCount = Application.StaticObjects.Count;
// Create an array of the same size.
Array myObjArray = Array.CreateInstance ( Type.GetType ( "System.Object" ) , ObjCount );
// Copy the entire collection into the array.
Application.StaticObjects.CopyTo ( myObjArray, 0 );
HttpStaticObjectsCollection Members HttpApplicationState.StaticObjects Property