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)

傳回

HttpHeaderValueCollection<T> 執行個體的列舉值。

實作

備註

這個列舉值會將集合的索引鍵當做字串傳回。 C# 語言的 foreach 陳述式 (在 Visual Basic 中為 for each) 會隱藏列舉值的複雜度。 因此,建議您使用 foreach,而不要直接使用列舉值。

列舉程式可以用來讀取集合中的資料,但是無法用來修改基礎集合。

一開始,列舉程式位在集合中的第一個項目之前。

適用於