HttpStaticObjectsCollection.CopyTo(Array, Int32) 方法
定义
将 HttpStaticObjectsCollection 的成员复制到数组。Copies members of an HttpStaticObjectsCollection into an array.
public:
virtual void CopyTo(Array ^ array, int index);
public void CopyTo (Array array, int index);
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
Public Sub CopyTo (array As Array, index As Integer)
参数
- array
- Array
将 HttpStaticObjectsCollection 复制到其中的数组。The array to copy the HttpStaticObjectsCollection into.
- index
- Int32
复制开始处的集合成员。The member of the collection where copying starts.
实现
示例
下面的示例创建一个 Object 所需大小的新数组,并将现有 StaticObjects 集合复制到其中。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 = 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.
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)