Evidence.AddHostEvidence(T) Evidence.AddHostEvidence(T) Evidence.AddHostEvidence(T) Evidence.AddHostEvidence(T) Method

定义

将指定类型的主机证据添加到主机证据集合。Adds host evidence of the specified type to the host evidence collection.

public:
generic <typename T>
 where T : System::Security::Policy::EvidenceBase void AddHostEvidence(T evidence);
[System.Runtime.InteropServices.ComVisible(false)]
public void AddHostEvidence<T> (T evidence) where T : System.Security.Policy.EvidenceBase;
member this.AddHostEvidence : 'T -> unit (requires 'T :> System.Security.Policy.EvidenceBase)
Public Sub AddHostEvidence(Of T As EvidenceBase) (evidence As T)

类型参数

T

evidence 中对象的类型。The type of the object in evidence.

参数

evidence
T T T T

要添加的主机证据。The host evidence to add.

异常

类型 T 的证据已在列表中。Evidence of type T is already in the list.

注解

不能添加旧证据,即不是派生自 EvidenceBase 的证据。Legacy evidence, that is, evidence that is not derived from EvidenceBase, cannot be added. 只能添加派生自 EvidenceBase 的证据。Only evidence that is derived from EvidenceBase can be added. 如果程序集列表中已经存在该类型的证据,则此方法不允许添加证据。This method does not allow you to add evidence if evidence of that type already exists in the assembly list.

适用于