Evidence.CopyTo Method (Array, Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Note: This API is now obsolete.

Copies evidence objects to an Array.

Namespace:   System.Security.Policy
Assembly:  mscorlib (in mscorlib.dll)

[ObsoleteAttribute("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


Type: System.Array

The target array to which to copy evidence objects.

Type: System.Int32

The zero-based position in the array to which to begin copying evidence objects.

Exception Condition

array is null.


index is outside the range of the target array.

The following code example shows the use of the CopyTo method. This example is part of a larger example provided for the Evidence class.

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)

.NET Framework
Available since 1.1
Return to top