Evidence.CopyTo(Array, Int32) メソッド

定義

注意事項

この API は非推奨になりました。

注意事項

Evidence should not be treated as an ICollection. Please use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.

注意事項

Evidence should not be treated as an ICollection. Use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.

Array に証拠オブジェクトをコピーします。

public:
 virtual void CopyTo(Array ^ array, int index);
[System.Obsolete]
public void CopyTo (Array array, int index);
[System.Obsolete("Evidence should not be treated as an ICollection. Please use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")]
public void CopyTo (Array array, int index);
[System.Obsolete("Evidence should not be treated as an ICollection. Use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")]
public void CopyTo (Array array, int index);
public void CopyTo (Array array, int index);
[<System.Obsolete>]
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
[<System.Obsolete("Evidence should not be treated as an ICollection. Please use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")>]
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
[<System.Obsolete("Evidence should not be treated as an ICollection. Use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")>]
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
Public Sub CopyTo (array As Array, index As Integer)

パラメーター

array
Array

証拠オブジェクトのコピー先の配列。

index
Int32

証拠オブジェクトのコピー開始位置を示す、配列内の 0 から始まるインデックス位置。

実装

属性

例外

array が null です。

index は、対象となる配列の範囲外です。

次のコード例は、 メソッドの使用方法を CopyTo 示しています。 この例は、 クラスに対して提供されるより大きな例の Evidence 一部です。

Console::WriteLine( "\nCopy the evidence to an array using CopyTo, then display the array." );
array<Object^>^evidenceArray = gcnew array<Object^>(myEvidence->Count);
myEvidence->CopyTo( evidenceArray, 0 );
for each (Object^ obj in evidenceArray)
{
   Console::WriteLine(obj->ToString());
}
Console.WriteLine("\nCopy the evidence to an array using CopyTo, then display the array.");
object[] evidenceArray = new object[myEvidence.Count];
myEvidence.CopyTo(evidenceArray, 0);
foreach (object obj in evidenceArray)
{
    Console.WriteLine(obj.ToString());
}
Console.WriteLine(ControlChars.Lf & "Copy the evidence to an array using CopyTo, then display the array.")
Dim evidenceArray(myEvidence.Count - 1) As Object
myEvidence.CopyTo(evidenceArray, 0)
Dim obj As Object
For Each obj In evidenceArray
    Console.WriteLine(obj.ToString())
Next obj

適用対象