Evidence.GetHostEnumerator 方法

定义

枚举由主机提供的证据。

public:
 System::Collections::IEnumerator ^ GetHostEnumerator();
public System.Collections.IEnumerator GetHostEnumerator ();
member this.GetHostEnumerator : unit -> System.Collections.IEnumerator
Public Function GetHostEnumerator () As IEnumerator

返回

AddHost(Object) 方法添加的证据的枚举数。

示例

以下示例演示如何使用 GetHostEnumerator 方法。 此示例是为 类提供的更大示例的 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())

适用于