CookieCollection CookieCollection CookieCollection CookieCollection Class

定义

Cookie 类的实例提供集合容器。Provides a collection container for instances of the Cookie class.

public ref class CookieCollection : System::Collections::ICollection
[System.Serializable]
public class CookieCollection : System.Collections.ICollection
type CookieCollection = class
    interface ICollection
    interface IEnumerable
Public Class CookieCollection
Implements ICollection
继承
CookieCollectionCookieCollectionCookieCollectionCookieCollection
属性
实现

注解

CookieCollectionICollection实现接口,以提供用于处理 cookie 集合的一般机制。The CookieCollection class implements an ICollection interface to provide a general mechanism for handling collections of cookies. 例如,当应用程序设计为存储多个服务器的 cookie 时,这非常有用。For example, this is useful in the case where an application is designed to store cookies for multiple servers.

构造函数

CookieCollection() CookieCollection() CookieCollection() CookieCollection()

初始化 CookieCollection 类的新实例。Initializes a new instance of the CookieCollection class.

属性

Count Count Count Count

获取 CookieCollection 中包含的 Cookie 的数目。Gets the number of cookies contained in a CookieCollection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

获取一个值,该值指示 CookieCollection 是否为只读。Gets a value that indicates whether a CookieCollection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

获取一个值,该值指示对 CookieCollection 的访问是否是线程安全的。Gets a value that indicates whether access to a CookieCollection is thread safe.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Cookie 中获取具有特定索引的 CookieCollectionGets the Cookie with a specific index from a CookieCollection.

Item[String] Item[String] Item[String] Item[String]

Cookie 中获取具有特定名称的 CookieCollectionGets the Cookie with a specific name from a CookieCollection.

SyncRoot SyncRoot SyncRoot SyncRoot

获取用于同步对 CookieCollection 的访问的对象。Gets an object to synchronize access to the CookieCollection.

方法

Add(Cookie) Add(Cookie) Add(Cookie) Add(Cookie)

Cookie 添加到 CookieCollectionAdds a Cookie to a CookieCollection.

Add(CookieCollection) Add(CookieCollection) Add(CookieCollection) Add(CookieCollection)

CookieCollection 的内容添加到当前实例中。Adds the contents of a CookieCollection to the current instance.

Clear() Clear() Clear() Clear()

CookieCollection 对象中移除所有元素。Removes all elements from the CookieCollection object.

Contains(Cookie) Contains(Cookie) Contains(Cookie) Contains(Cookie)

确定指定的 cookie 是否在 CookieCollection 中。Determines whether the specified cookie is in the CookieCollection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

CookieCollection 的元素复制到指定数组,从特定索引开始。Copies the elements of a CookieCollection to the specified array, starting at a particular index.

CopyTo(Cookie[], Int32) CopyTo(Cookie[], Int32) CopyTo(Cookie[], Int32) CopyTo(Cookie[], Int32)

将该 CookieCollection 的元素复制到在目标数组的指定索引处开始的 Cookie 数组。Copies the elements of this CookieCollection to a Cookie array starting at the specified index of the target array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

获取可循环访问 CookieCollection 的枚举器。Gets an enumerator that can iterate through a CookieCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(Cookie) Remove(Cookie) Remove(Cookie) Remove(Cookie)

CookieCollection 中移除指定的 cookie。Removes the specified cookie from the CookieCollection.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot
IEnumerable<Cookie>.GetEnumerator() IEnumerable<Cookie>.GetEnumerator() IEnumerable<Cookie>.GetEnumerator() IEnumerable<Cookie>.GetEnumerator()

获取可循环访问 CookieCollection 的枚举器。Gets an enumerator that can iterate through the CookieCollection.

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅