Evidence.Count 属性

获取证据集中证据对象的数目。

**命名空间:**System.Security.Policy
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public ReadOnly Property Count As Integer
用法
Dim instance As Evidence
Dim value As Integer

value = instance.Count
public int Count { get; }
public:
virtual property int Count {
    int get () sealed;
}
/** @property */
public final int get_Count ()
public final function get Count () : int

属性值

证据集中证据对象的数目。

示例

下面的代码示例演示 Count 属性的用法。此示例摘自为 Evidence 类提供的一个更大的示例。

Console.WriteLine(ControlChars.Lf & "Make a copy of the current evidence.")
Dim evidenceCopy As New Evidence(myEvidence)
Console.WriteLine(("Count of new evidence items = " & evidenceCopy.Count.ToString()))
Console.WriteLine(("Does the copy equal the current evidence? " & myEvidence.Equals(evidenceCopy)))
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));
Console::WriteLine( "\nMake a copy of the current evidence." );
Evidence^ evidenceCopy = gcnew Evidence( myEvidence );
Console::WriteLine( "Count of new evidence items = {0}", evidenceCopy->Count );
Console::WriteLine( "Does the copy equal the current evidence? {0}", myEvidence->Equals( evidenceCopy ) );
Console.WriteLine("\nMake a copy of the current evidence.");
Evidence evidenceCopy = new Evidence(myEvidence);
Console.WriteLine(("Count of new evidence items = " 
    + evidenceCopy.get_Count()));
Console.WriteLine(("Does the copy equal the current evidence? " 
    + System.Convert.ToString(myEvidence.Equals(evidenceCopy))));

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0

请参见

参考

Evidence 类
Evidence 成员
System.Security.Policy 命名空间