SecurityManager 类

定义

注意

Code Access Security is not supported or honored by the runtime.

提供与安全系统交互的类的主要接入点。 此类不能被继承。

public ref class SecurityManager abstract sealed
public ref class SecurityManager sealed
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static class SecurityManager
public sealed class SecurityManager
[System.Runtime.InteropServices.ComVisible(true)]
public static class SecurityManager
public static class SecurityManager
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SecurityManager = class
type SecurityManager = class
[<System.Runtime.InteropServices.ComVisible(true)>]
type SecurityManager = class
Public Class SecurityManager
Public NotInheritable Class SecurityManager
继承
SecurityManager
属性

注解

Caution

代码访问安全性(CAS)已在 .NET Framework 和 .NET 的所有版本中弃用。 如果使用与 CAS 相关的 API,最新版本的 .NET 不会遵循 CAS 注释,并会生成错误。 开发人员应寻求完成安全任务的替代方法。

安全性提供访问和操作安全策略配置的方法。 不能创建SecurityManager的实例。

属性

名称 说明
CheckExecutionRights
已过时.
已过时.

获取或设置一个值,该值指示代码是否必须有 Execution 才能执行。

SecurityEnabled
已过时.
已过时.
已过时.

获取或设置一个值,该值指示是否启用安全性。

方法

名称 说明
CurrentThreadRequiresSecurityContextCapture()
已过时.

确定当前线程是否需要在以后的时间点重新创建其安全上下文捕获。

GetStandardSandbox(Evidence)
已过时.

获取一个权限集,该权限集可以安全地授予具有提供证据的应用程序。

GetZoneAndOrigin(ArrayList, ArrayList)
已过时.

获取当前程序集的已授予区域标识和 URL 标识权限集。

IsGranted(IPermission)
已过时.
已过时.

确定是否向调用方授予权限。

LoadPolicyLevelFromFile(String, PolicyLevelType)
已过时.
已过时.

从指定的文件加载 a PolicyLevel

LoadPolicyLevelFromString(String, PolicyLevelType)
已过时.
已过时.

从指定的字符串加载 a PolicyLevel

PolicyHierarchy()
已过时.
已过时.

提供一个枚举器,用于按级别(例如计算机策略和用户策略)访问安全策略层次结构。

ResolvePolicy(Evidence, PermissionSet, PermissionSet, PermissionSet, PermissionSet)
已过时.
已过时.

确定基于指定证据和请求授予代码的权限。

ResolvePolicy(Evidence)
已过时.
已过时.

确定基于指定证据授予代码的权限。

ResolvePolicy(Evidence[])
已过时.
已过时.

确定基于指定证据授予代码的权限。

ResolvePolicyGroups(Evidence)
已过时.
已过时.

获取与指定证据匹配的代码组的集合。

ResolveSystemPolicy(Evidence)
已过时.
已过时.

根据指定的证据确定要授予对代码的权限,不包括级别策略 AppDomain

SavePolicy()
已过时.
已过时.

保存修改后的安全策略状态。

SavePolicyLevel(PolicyLevel)
已过时.
已过时.

保存加载的 LoadPolicyLevelFromFile(String, PolicyLevelType)已修改的安全策略级别。

适用于