Export (0) Print
Expand All

CookieCollection.GetEnumerator Method

Gets an enumerator that can iterate through a CookieCollection.

[Visual Basic]
Public Overridable Function GetEnumerator() As IEnumerator _
   Implements IEnumerable.GetEnumerator
[C#]
public virtual IEnumerator GetEnumerator();
[C++]
public: virtual IEnumerator* GetEnumerator();
[JScript]
public function GetEnumerator() : IEnumerator;

Return Value

An instance of an implemention of an IEnumerator interface that can iterate through a CookieCollection.

Implements

IEnumerable.GetEnumerator

Remarks

You should use an IEnumerator only to read data in the collection. Enumerators cannot be used to modify the underlying collection. The enumerator does not have exclusive access to the collection.

When an enumerator is created, it takes a snapshot of the current state of the collection. If changes such as adding, modifying, or deleting elements are made to the collection, the snapshot gets out of sync and the enumerator throws an InvalidOperationException. Two enumerators created from the same collection at the same time can produce different snapshots of the collection.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CookieCollection Class | CookieCollection Members | System.Net Namespace

Show:
© 2014 Microsoft