CookieContainer.Capacity 속성

정의

CookieContainer가 보유할 수 있는 Cookie 인스턴스의 수를 가져오거나 설정합니다.

public:
 property int Capacity { int get(); void set(int value); };
public:
 property int Capacity { int get(); };
public int Capacity { get; set; }
public int Capacity { get; }
member this.Capacity : int with get, set
member this.Capacity : int
Public Property Capacity As Integer
Public ReadOnly Property Capacity As Integer

속성 값

Cookie가 보유할 수 있는 CookieContainer 인스턴스의 수입니다. 이 한계는 초과할 수 없는 한계이므로 Cookie를 추가할 때 이 한계를 초과하지 않도록 합니다.

예외

Capacity가 0보다 작거나 같음(값이 보다 PerDomainCapacity 작고 Int32.MaxValuePerDomainCapacity 같지 않음).

설명

가 같거나 초과Capacity하면 Count 하나 이상의 Cookie 인스턴스가 컨테이너에서 제거됩니다. 아래와 같이 충분한 Capacity 인스턴스가 제거 Count 됩니다. scope 만료된 Cookie 인스턴스가 있는 경우 정리됩니다. 그렇지 않은 경우 가장 최근에 사용된 CookieCollection 가 컨테이너에서 발견되고 제거됩니다.

CapacityPerDomainCapacity보다 크거나 같아야 합니다.

적용 대상

추가 정보