Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Net.​CookieCollection
Assembly: System.Net.Primitives
Inheritance: object → CookieCollection
Provides a collection container for instances of the <see cref="T:System.Net.Cookie" /> class.
Properties
public
int
Count
Gets the number of cookies contained in a <see cref="T:System.Net.CookieCollection" /> .
public
bool
IsReadOnly
Gets a value that indicates whether a <see cref="T:System.Net.CookieCollection" /> is read-only.
public
bool
IsSynchronized
Gets a value that indicates whether access to a <see cref="T:System.Net.CookieCollection" /> is thread safe.
public
Cookie
Item
public
Cookie
Item
public
object
SyncRoot
Gets an object to synchronize access to the <see cref="T:System.Net.CookieCollection" /> .
Methods
public
void
Add​(Cookie cookie)
cookie
The <see cref="T:System.Net.Cookie" /> to be added to a <see cref="T:System.Net.CookieCollection" /> .
Adds a <see cref="T:System.Net.Cookie" /> to a <see cref="T:System.Net.CookieCollection" /> .
public
void
Add​(CookieCollection cookies)
cookies
The <see cref="T:System.Net.CookieCollection" /> to be added.
Adds the contents of a <see cref="T:System.Net.CookieCollection" /> to the current instance.
public
void
Clear​()
Removes all elements from the <see cref="T:System.Net.CookieCollection" /> object.
public
bool
Contains​(Cookie cookie)
cookie
The cookie to locate in the <see cref="T:System.Net.CookieCollection" /> .
Returns <see langword="true" /> if the specified cookie is found in the <see cref="T:System.Net.CookieCollection" /> ; otherwise, <see langword="false" /> .
Determines whether the specified cookie is in the <see cref="T:System.Net.CookieCollection" /> .
public
void
CopyTo​(Array array,
int index)
array
The target array to which the <see cref="T:System.Net.CookieCollection" /> will be copied.
index
The zero-based index in the target array where copying begins.
Copies the elements of a <see cref="T:System.Net.CookieCollection" /> to the specified array, starting at a particular index.
public
void
CopyTo​(Cookie[] array,
int index)
array
The target <see cref="T:System.Net.Cookie" /> array to which the <see cref="T:System.Net.CookieCollection" /> will be copied.
index
The zero-based index in the target array where copying begins.
Copies the elements of this <see cref="T:System.Net.CookieCollection" /> to a <see cref="T:System.Net.Cookie" /> array starting at the specified index of the target array.
GetEnumerator​()
Returns An <see cref="T:System.Collections.IEnumerator" /> for this collection.
Gets an enumerator that can iterate through a <see cref="T:System.Net.CookieCollection" /> .
public
bool
Remove​(Cookie cookie)
cookie
The cookie to remove from the <see cref="T:System.Net.CookieCollection" /> .
Returns <see langword="true" /> if <paramref name="cookie" /> was successfully removed from the <see cref="T:System.Net.CookieCollection" /> ; otherwise, <see langword="false" /> . This method also returns <see langword="false" /> if item is not found in the original collection.
Removes the specified cookie from the <see cref="T:System.Net.CookieCollection" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object