Add Method (Uri, CookieCollection)
Collapse the table of content
Expand the table of content

CookieContainer.Add Method (Uri, CookieCollection)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Adds the contents of the specified CookieCollection with the specified Uniform Resource Identifier (URI) to this CookieContainer.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

public void Add(
	Uri uri,
	CookieCollection cookies
)

Parameters

uri
Type: System.Uri
The URI of the CookieCollection to add to this CookieContainer.
cookies
Type: System.Net.CookieCollection
The CookieCollection containing the cookies to add to this CookieContainer.

ExceptionCondition
ArgumentNullException

cookies is null.

ArgumentException

The domain for one of the cookie objects in cookies is null.

CookieException

One of the cookie objects in cookies contains an invalid domain.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft