## CookieContainer::Add(System::SharedPtr\<Cookie\>) method


向集合中添加一个 Cookie。

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Cookie> cookie)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| Cookie | System::SharedPtr\<Cookie\> | 要添加的 Cookie。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Cookie](../../cookie/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.Font for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<Cookie\>, bool) method


向集合中添加一个 Cookie。

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Cookie> cookie, bool throwOnError)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| Cookie | System::SharedPtr\<Cookie\> | 要添加的 Cookie。 |
| throwOnError | bool | 指示在发生错误时是否会抛出异常的值。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Cookie](../../cookie/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.Font for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<CookieCollection\>) method


将 Cookie 从指定的集合复制到当前集合。

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<CookieCollection> cookies)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| Cookies | System::SharedPtr\<CookieCollection\> | 将从中复制 Cookie 的集合。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [CookieCollection](../../cookiecollection/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.Font for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<Uri\>, System::SharedPtr\<Cookie\>) method


为指定的 URI 添加一个 Cookie。

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Uri> uri, System::SharedPtr<Cookie> cookie)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| uri | System::SharedPtr\<Uri\> | Cookie 的 URI。 |
| Cookie | System::SharedPtr\<Cookie\> | 要添加的 Cookie。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Uri](../../../system/uri/)
* Class [Cookie](../../cookie/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.Font for C++](../../../)
## CookieContainer::Add(System::SharedPtr\<Uri\>, System::SharedPtr\<CookieCollection\>) method


将指定集合中针对指定 URI 的 Cookie 复制到当前集合。

```cpp
void System::Net::CookieContainer::Add(System::SharedPtr<Uri> uri, System::SharedPtr<CookieCollection> cookies)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| uri | System::SharedPtr\<Uri\> | Cookie 的 URI。 |
| Cookies | System::SharedPtr\<CookieCollection\> | 必须从中复制 Cookie 的 Cookie 集合。 |

## 另见

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Uri](../../../system/uri/)
* Class [CookieCollection](../../cookiecollection/)
* Class [CookieContainer](../)
* Namespace [System::Net](../../)
* Library [Aspose.Font for C++](../../../)
