MulticastIPAddressInformationCollection.GetEnumerator 方法

定义

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

public:
 virtual System::Collections::Generic::IEnumerator<System::Net::NetworkInformation::MulticastIPAddressInformation ^> ^ GetEnumerator();
public virtual System.Collections.Generic.IEnumerator<System.Net.NetworkInformation.MulticastIPAddressInformation> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<System.Net.NetworkInformation.MulticastIPAddressInformation>
override this.GetEnumerator : unit -> System.Collections.Generic.IEnumerator<System.Net.NetworkInformation.MulticastIPAddressInformation>
Public Overridable Function GetEnumerator () As IEnumerator(Of MulticastIPAddressInformation)

返回

IEnumerator<MulticastIPAddressInformation>

一个对象,它实现了 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. 如果在使用枚举器时修改了集合,则尝试通过调用或引发来设置位置 MoveNext Reset InvalidOperationExceptionIf the collection is modified while an enumerator is in use, an attempt to set the position by calling MoveNext or Reset causes an InvalidOperationException.

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

适用于