AppDomainManager.CheckSecuritySettings(SecurityState) AppDomainManager.CheckSecuritySettings(SecurityState) AppDomainManager.CheckSecuritySettings(SecurityState) AppDomainManager.CheckSecuritySettings(SecurityState) Method

定义

指示是否允许在应用程序域中执行指定的操作。Indicates whether the specified operation is allowed in the application domain.

public:
 virtual bool CheckSecuritySettings(System::Security::SecurityState ^ state);
public virtual bool CheckSecuritySettings (System.Security.SecurityState state);
abstract member CheckSecuritySettings : System.Security.SecurityState -> bool
override this.CheckSecuritySettings : System.Security.SecurityState -> bool
Public Overridable Function CheckSecuritySettings (state As SecurityState) As Boolean

参数

state
SecurityState SecurityState SecurityState SecurityState

SecurityState 的一个子类,用来标识请求其安全状态的操作。A subclass of SecurityState that identifies the operation whose security status is requested.

返回

如果宿主允许在应用程序域中执行 state 指定的操作,则为 true;否则为 falsetrue if the host allows the operation specified by state to be performed in the application domain; otherwise, false.

注解

此方法的默认实现返回falseThe default implementation of this method returns false.

调用IsolatedStorageFile.IncreaseQuotaTo方法以增加独立存储配额时, 将调用此方法。This method is called when the IsolatedStorageFile.IncreaseQuotaTo method has been called to increase the isolated storage quota. 托管公共语言运行时 (CLR) 的应用程序可以重写CheckSecuritySettings方法以基于IsolatedStorageSecurityState对象 (继承SecurityState) 执行策略决策, 然后可以允许或阻止增加。An application that hosts the common language runtime (CLR) can override the CheckSecuritySettings method to perform policy decisions based on an IsolatedStorageSecurityState object (which inherits SecurityState), and can then allow or prevent the increase. 例如, 主机可能会提示最终用户批准或拒绝增加配额的请求。For example, a host could prompt the end user to approve or deny the request to increase the quota. 主机的实现CheckSecuritySettings应考虑拒绝服务攻击的可能性。The host's implementation of CheckSecuritySettings should take into account the possibility of denial-of-service attacks. 例如, 只有在用户启动的事件 (例如按钮单击) 中调用方法时, 才应提示用户。For example, it should prompt the user only if the method is called from a user-initiated event such as a button click.

适用于