CookieContainer.Capacity Propriedade
Definição
Obtém ou define o número de instâncias de Cookie que um CookieContainer pode conter.Gets or sets the number of Cookie instances that a CookieContainer can hold.
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
Valor da propriedade
O número de Cookie instâncias que um CookieContainer pode conter.The number of Cookie instances that a CookieContainer can hold. Esse é um limite rígido e não pode ser excedido com a adição de um Cookie .This is a hard limit and cannot be exceeded by adding a Cookie.
Exceções
Capacity é menor ou igual a zero ou (o valor é menor que PerDomainCapacity e PerDomainCapacity não é igual a MaxValue).Capacity is less than or equal to zero or (value is less than PerDomainCapacity and PerDomainCapacity is not equal to MaxValue).
Comentários
Se Count for igual a ou exceder Capacity , uma ou mais Cookie instâncias serão removidas do contêiner.If Count equals or exceeds Capacity, one or more Cookie instances are removed from the container. Instâncias suficientes são removidas para ficar Count abaixo Capacity da seguinte maneira: se houver instâncias expiradas Cookie no escopo, elas serão limpas.Enough instances are removed to bring Count below Capacity as follows: if there are expired Cookie instances in scope, they are cleaned up. Caso contrário, o usado pelo menos recentemente CookieCollection é encontrado e removido do contêiner.If not, then the least recently used CookieCollection is found and removed from the container.
Capacity deve ser maior ou igual a PerDomainCapacity.Capacity must be greater than or equal to PerDomainCapacity.