MulticastIPAddressInformationCollection.IEnumerable.GetEnumerator MulticastIPAddressInformationCollection.IEnumerable.GetEnumerator MulticastIPAddressInformationCollection.IEnumerable.GetEnumerator Method


返回一个可用于循环访问此集合的对象。Returns an object that can be used to iterate through this collection.

 virtual System::Collections::IEnumerator ^ System.Collections.IEnumerable.GetEnumerator() = System::Collections::IEnumerable::GetEnumerator;
System.Collections.IEnumerator IEnumerable.GetEnumerator ();
Function GetEnumerator () As IEnumerator Implements IEnumerable.GetEnumerator


一个对象,它实现了 IEnumerator 接口,并提供对此集合中的 UnicastIPAddressInformation 类型的访问。An object that implements the IEnumerator interface and provides access to the UnicastIPAddressInformation types in this collection.



此方法返回的对象最初定位在此集合中的第一个元素之前。The object that is returned by this method is initially positioned before the first element in this collection. 必须先调用MoveNext方法, 然后才能访问第一个元素。You must call the MoveNext method before you can access the first element. 若要访问当前位置的元素, 请调用Current属性。To access the element at the current position, call the Current property.

请不要在使用枚举器时修改该集合。Do not modify the collection while using the enumerator. 如果在使用枚举器时修改了集合, 则尝试通过调用MoveNextReset引发InvalidOperationException来设置位置。If the collection is modified while an enumerator is in use, an attempt to set the position by calling MoveNext or Reset causes an InvalidOperationException.

有关枚举器的详细说明, 请参阅IEnumeratorGetEnumerator和方法的文档。For a detailed description of enumerators, see the documentation for the IEnumerator class and the GetEnumerator method.