Evidence.AddAssembly(Object) Evidence.AddAssembly(Object) Evidence.AddAssembly(Object) Evidence.AddAssembly(Object) Method

定义

警告

此 API 现已过时。

将指定的程序集证据添加到证据集。Adds the specified assembly evidence to the evidence set.

public:
 void AddAssembly(System::Object ^ id);
[System.Obsolete]
[System.Obsolete("This method is obsolete. Please use AddAssemblyEvidence instead.")]
public void AddAssembly (object id);
member this.AddAssembly : obj -> unit
Public Sub AddAssembly (id As Object)

参数

id
Object Object Object Object

任意证据对象。Any evidence object.

异常

id 不可序列化。id is not serializable.

示例

下面的代码示例演示AddAssembly方法的用法。The following code example shows the use of the AddAssembly method. 此示例是为Evidence类提供的更大示例的一部分。This example is part of a larger example provided for the Evidence class.

Console::WriteLine( "Adding assembly evidence." );
myEvidence->AddAssembly( "SN01" );
myEvidence->AddAssembly( gcnew Version( "0.0.0.0" ) );
myEvidence->AddAssembly( mSN );
Console::WriteLine( "Count of evidence items = {0}", myEvidence->Count );
Console.WriteLine("Adding assembly evidence.");
myEvidence.AddAssembly("SN01");
myEvidence.AddAssembly(new Version("0.0.0.0"));
myEvidence.AddAssembly(mSN);
Console.WriteLine("Count of evidence items = " + myEvidence.Count.ToString());
Console.WriteLine("Adding assembly evidence.")
myEvidence.AddAssembly("SN01")
myEvidence.AddAssembly(New Version("0.0.0.0"))
myEvidence.AddAssembly(mSN)
Console.WriteLine(("Count of evidence items = " & myEvidence.Count.ToString()))

注解

将此方法用于从程序集派生的证据。Use this method for evidence derived from the assembly.

备注

此方法不执行检查来阻止添加重复类型的证据。This method does not perform a check to prevent adding duplicate types of evidence. 许多程序集证据对象可以同时存在。Many assembly evidence objects can exist at the same time.

适用于