| |||||
HttpStaticObjectsCollection.CopyTo MethodSystem.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 ); Parameters
ImplementsExampleThe 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 ); See AlsoHttpStaticObjectsCollection Members HttpApplicationState.StaticObjects Property |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme