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.
Assembly: System.Net (in System.Net.dll)
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.
| Exception | Condition |
|---|---|
| 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. |
Show: