Partage via


Evidence.CopyTo(Array, Int32) Méthode

Définition

Attention

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

Attention

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

Attention

Cette API est à présent déconseillée.

Copie des objets de preuve dans Array.

public:
 virtual 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("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]
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.")>]
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
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>]
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
Public Sub CopyTo (array As Array, index As Integer)

Paramètres

array
Array

Tableau cible vers lequel les objets de preuve doivent être copiés.

index
Int32

Position de base zéro dans le tableau vers lequel commencer à copier des objets de preuve.

Implémente

Attributs

Exceptions

array a la valeur null.

index est en dehors de la plage du tableau cible.

Exemples

L’exemple de code suivant montre l’utilisation de la CopyTo méthode . Cet exemple fait partie d’un exemple plus grand fourni pour la Evidence classe .

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

S’applique à