Evidence.GetHostEnumerator 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
列舉主應用程式提供的辨識碼。
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())