CookieContainer.Add Method (Uri, Cookie)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Adds the specified Cookie 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 cookie to add to this CookieContainer.
- cookie
- Type: System.Net.Cookie
The Cookie to add to this CookieContainer.
| Exception | Condition |
|---|---|
| ArgumentNullException | cookie is null. |
| ArgumentException | The domain for cookie is null. |
| CookieException | cookie is larger than MaxCookieSize. -or- the domain for cookie is not a valid URI. |
Show: