Evidence.Count 屬性

定義

警告

Evidence should not be treated as an ICollection. Use GetHostEnumerator and GetAssemblyEnumerator to iterate over the evidence to collect a count.

警告

Evidence should not be treated as an ICollection. Please use GetHostEnumerator and GetAssemblyEnumerator to iterate over the evidence to collect a count.

警告

此 API 現已淘汰。

取得辨識項集合 (Evidence Set) 中的辨識項物件數。

C#
[System.Obsolete("Evidence should not be treated as an ICollection. Use GetHostEnumerator and GetAssemblyEnumerator to iterate over the evidence to collect a count.")]
public int Count { get; }
C#
public int Count { get; }
C#
[System.Obsolete("Evidence should not be treated as an ICollection. Please use GetHostEnumerator and GetAssemblyEnumerator to iterate over the evidence to collect a count.")]
public int Count { get; }
C#
[System.Obsolete]
public int Count { get; }

屬性值

辨識項集合中的辨識項物件數。

實作

屬性

範例

下列程式代碼範例示範 如何使用 Count 屬性。 這個範例是提供給 類別之較大範例的 Evidence 一部分。

C#
Console.WriteLine("\nMake a copy of the current evidence.");
Evidence evidenceCopy = new Evidence(myEvidence);
Console.WriteLine("Count of new evidence items = " + evidenceCopy.Count);
Console.WriteLine("Does the copy equal the current evidence? " + myEvidence.Equals(evidenceCopy));

適用於

產品 版本 (已過時)
.NET (6, 7, 8, 9)
.NET Framework 1.1, 2.0, 3.0, 3.5 (4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)
.NET Standard (2.0)
Windows Desktop (3.0, 3.1, 5, 6, 7, 8, 9)