HostSecurityManager.DomainPolicy 属性

定义

注意

AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

在派生类中重写时,获取当前应用程序域的安全策略。When overridden in a derived class, gets the security policy for the current application domain.

public:
 virtual property System::Security::Policy::PolicyLevel ^ DomainPolicy { System::Security::Policy::PolicyLevel ^ get(); };
public virtual System.Security.Policy.PolicyLevel DomainPolicy { get; }
[System.Obsolete("AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public virtual System.Security.Policy.PolicyLevel DomainPolicy { get; }
member this.DomainPolicy : System.Security.Policy.PolicyLevel
[<System.Obsolete("AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
member this.DomainPolicy : System.Security.Policy.PolicyLevel
Public Overridable ReadOnly Property DomainPolicy As PolicyLevel

属性值

PolicyLevel

当前应用程序域的安全策略。The security policy for the current application domain. 默认值为 nullThe default is null.

属性

例外

此方法使用代码访问安全性 (CAS) 策略,该策略在 .NET Framework 4 中已过时。This method uses code access security (CAS) policy, which is obsolete in the .NET Framework 4. 若要使 CAS 策略与早期版本的 .NET Framework 兼容,请使用 <legacyCasPolicy> 元素To enable CAS policy for compatibility with earlier versions of the .NET Framework, use the <legacyCasPolicy> element.

注解

此属性可在派生类中重写。This property can be overridden in a derived class. 此基实现总是返回 nullThe base implementation always returns null.

此属性是在 AppDomain 创建时调用的。This property is called at AppDomain creation time. 它允许主机为当前提供策略 AppDomainIt allows a host to supply a policy for the current AppDomain. 策略级别由以下内容组成:A policy level consists of the following:

  • 组织成单个根树的一组代码组。A set of code groups organized into a single rooted tree.

  • 一组命名权限集,代码组引用这些权限集来指定要授予代码组代码的权限。A set of named permission sets that are referenced by the code groups to specify permissions to be granted to code belonging to the code group.

  • 完全受信任的程序集的列表。A list of fully trusted assemblies.

重要

有关关键实现的信息,请参阅类的对继承者的说明 HostSecurityManagerSee the Notes to Inheritors for the HostSecurityManager class for critical implementation information.

适用于