HttpHeaderValueCollection<T>.GetEnumerator 方法

定义

返回循环访问 HttpHeaderValueCollection<T> 的枚举数。

public:
 virtual System::Collections::Generic::IEnumerator<T> ^ GetEnumerator();
public System.Collections.Generic.IEnumerator<T> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T (requires 'T : null)>
override this.GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T (requires 'T : null)>
Public Function GetEnumerator () As IEnumerator(Of T)
Public Iterator Overridable NotOverridable Function GetEnumerator () As IEnumerator(Of T)

返回

IEnumerator<T>

HttpHeaderValueCollection<T> 实例的枚举器。

实现

注解

此枚举器将集合的键作为字符串返回。 C# 语言的 foreach 语句(在 Visual Basic 中为 for each)隐藏了枚举数的复杂性。 因此,建议使用 foreach,而不是直接操作枚举数。

枚举器可用于读取集合中的数据,但不能用于修改基础集合。

最初,枚举数定位在集合中第一个元素的前面。

适用于