Evidence.AddHost(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
此 API 現已淘汰。
警告
This method is obsolete. Please use AddHostEvidence instead.
警告
Evidence.AddHost has been deprecated. Use AddHostEvidence instead.
加入主應用程式提供的指定辨識項到辨識項集合。
public:
void AddHost(System::Object ^ id);
[System.Obsolete]
public void AddHost (object id);
[System.Obsolete("This method is obsolete. Please use AddHostEvidence instead.")]
public void AddHost (object id);
[System.Obsolete("Evidence.AddHost has been deprecated. Use AddHostEvidence instead.")]
public void AddHost (object id);
public void AddHost (object id);
[<System.Obsolete>]
member this.AddHost : obj -> unit
[<System.Obsolete("This method is obsolete. Please use AddHostEvidence instead.")>]
member this.AddHost : obj -> unit
[<System.Obsolete("Evidence.AddHost has been deprecated. Use AddHostEvidence instead.")>]
member this.AddHost : obj -> unit
member this.AddHost : obj -> unit
Public Sub AddHost (id As Object)
參數
- id
- Object
任何辨識項物件。
- 屬性
例外狀況
id
為 null。
id
不可序列化。
範例
下列程式碼範例顯示 方法的使用 AddHost 方式。 此範例是針對 類別提供的較大範例的 Evidence 一部分。
Url^ url = gcnew Url( "http://www.treyresearch.com" );
Console::WriteLine( "Adding host evidence {0}", url );
ev2a->AddHost( url );
Evidence^ ev2b = gcnew Evidence( ev2a );
Console::WriteLine( "Copy evidence into new evidence" );
IEnumerator^ enum1 = ev2b->GetHostEnumerator();
enum1->MoveNext();
Console::WriteLine( enum1->Current );
Url url = new Url("http://www.treyresearch.com");
Console.WriteLine("Adding host evidence " + url.ToString());
ev2a.AddHost(url);
Evidence ev2b = new Evidence(ev2a);
Console.WriteLine("Copy evidence into new evidence");
IEnumerator enum1 = ev2b.GetHostEnumerator();
enum1.MoveNext();
Console.WriteLine(enum1.Current.ToString());
Dim url As New Url("http://www.treyresearch.com")
Console.WriteLine(("Adding host evidence " & url.ToString()))
ev2a.AddHost(url)
Dim ev2b As New Evidence(ev2a)
Console.WriteLine("Copy evidence into new evidence")
Dim enum1 As IEnumerator = ev2b.GetHostEnumerator()
enum1.MoveNext()
Console.WriteLine(enum1.Current.ToString())
備註
針對主機所提供的辨識項,請使用這個方法。
注意
這個方法不會執行檢查,以防止新增重複的辨識項類型。 許多主機辨識項物件可以同時存在。