CookieContainer.GetCookies(Uri) 方法

定义

获取包含与特定 URI 关联的 CookieCollection 实例的 CookieGets a CookieCollection that contains the Cookie instances that are associated with a specific URI.

public:
 System::Net::CookieCollection ^ GetCookies(Uri ^ uri);
public System.Net.CookieCollection GetCookies (Uri uri);
member this.GetCookies : Uri -> System.Net.CookieCollection

参数

uri
Uri

所需的 Cookie 实例的 URI。The URI of the Cookie instances desired.

返回

包含与特定 URI 关联的 CookieCollection 实例的 CookieA CookieCollection that contains the Cookie instances that are associated with a specific URI.

异常

urinulluri is null.

注解

创建 CookieCollection 的新实例。A new instance of a CookieCollection is created. 然后,将读取与指定 URI 关联的内部集合中的 Cookie 实例,并将其添加到新的 CookieCollection中。Then the Cookie instances in the internal collection that are associated with the specified URI are read out and added to the new CookieCollection.

适用于

另请参阅