IsolatedStorageFile.IncreaseQuotaTo(Int64) 方法

定义

使应用程序显式请求一个更大的配额大小,以字节为单位。Enables an application to explicitly request a larger quota size, in bytes.

public:
 override bool IncreaseQuotaTo(long newQuotaSize);
public override bool IncreaseQuotaTo (long newQuotaSize);
[System.Runtime.InteropServices.ComVisible(false)]
public override bool IncreaseQuotaTo (long newQuotaSize);
override this.IncreaseQuotaTo : int64 -> bool
Public Overrides Function IncreaseQuotaTo (newQuotaSize As Long) As Boolean

参数

newQuotaSize
Int64

请求的大小,以字节为单位。The requested size, in bytes.

返回

如果接受新配额,则为 true;否则为 falsetrue if the new quota is accepted; otherwise, false.

属性

异常

newQuotaSize 小于当前配额大小。newQuotaSize is less than current quota size.

newQuotaSize 小于零,或小于或等于当前配额大小。newQuotaSize is less than zero, or less than or equal to the current quota size.

已关闭独立存储区。The isolated store has been closed.

当前作用域不是针对应用程序用户的。The current scope is not for an application user.

已释放独立存储区。The isolated store has been disposed.

已移除独立存储区。The isolated store has been removed.

-或--or-

已禁用独立存储。Isolated storage is disabled.

注解

使用 IncreaseQuotaTo 方法,应用程序可以显式请求更大的配额大小(以字节为单位)。The IncreaseQuotaTo method enables an application to explicitly request a larger quota size in bytes. 新的配额大小不得小于当前配额大小,因为只允许增加配额。The new quota size must not be smaller than the current quota size, because only quota increases are allowed.

无论何时调用 IncreaseQuotaTo 方法,独立存储都将调用 CheckSecuritySettings 方法。Whenever the IncreaseQuotaTo method is called, isolated storage calls the CheckSecuritySettings method.

您可以通过创建一个自定义 AppDomainManager 对象来实现策略决策,该对象将重写 CheckSecuritySettings 方法,以便对象可以基于 IsolatedStorageSecurityState 的对象执行策略决策。You can implement policy decisions by creating a custom AppDomainManager object that overrides the CheckSecuritySettings method so that the object can perform policy decisions based on a IsolatedStorageSecurityState object.

如果没有自定义 AppDomainManager 对象,则会拒绝配额增加请求,因为 CheckSecuritySettings 的默认实现将返回 falseIf there is no custom AppDomainManager object, the quota increase request is denied, because the default implementation for CheckSecuritySettings returns false.

目前,.NET Framework 中的任何主机均不提供此自定义,因此 IncreaseQuotaTo 总是返回 falseCurrently, none of the hosts in the .NET Framework provide this customization, so IncreaseQuotaTo always returns false.

适用于

另请参阅