信息
您所需的主题如下所示。但此主题未包含在此库中。
此主题尚未评级 - 评价此主题

Type.IsSecurityCritical 属性

.NET Framework 4.5

获取一个值,该值指示当前的类型在当前信任级别上是安全关键的还是安全可靠关键的,并因此可以执行关键操作。

命名空间:  System
程序集:  mscorlib(在 mscorlib.dll 中)
public virtual bool IsSecurityCritical { get; }

属性值

类型:System.Boolean
如果当前类型在当前信任级别上是安全关键的或安全可靠关键的,则为 true;如果它是透明的,则为 false

The IsSecurityCritical, IsSecuritySafeCritical, and IsSecurityTransparent properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table:

Security level

IsSecurityCritical

IsSecuritySafeCritical

IsSecurityTransparent

Critical

true

false

false

Safe critical

true

true

false

Transparent

false

false

true

Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules.

重要说明重要事项

For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the Assembly.IsFullyTrusted and AppDomain.IsFullyTrusted properties.

For more information about reflection and transparency, see 反射的安全注意事项. For information about transparency, see .NET Framework 中的安全性更改.

.NET Framework

受以下版本支持:4.5、4

.NET Framework Client Profile

受以下版本支持:4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008(不支持服务器核心角色), Windows Server 2008 R2(支持带 SP1 或更高版本的服务器核心角色;不支持 Itanium)

并不是.NET Framework 对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求.
本文是否对您有所帮助?
(1500 个剩余字符)
感谢您的反馈

社区附加资源

显示:
© 2014 Microsoft. 版权所有。