Share via


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
屬性

備註

警告

程式代碼啟用安全性 (CAS) 已在所有版本的 .NET Framework 和 .NET 中已被取代。 最新版本的 .NET 不接受 CAS 批注,並在使用 CAS 相關 API 時產生錯誤。 開發人員應尋求替代方案來完成安全性工作。

安全性提供存取和操作安全策略設定的方法。 您無法建立 的 SecurityManager實例。

屬性

CheckExecutionRights
已淘汰.
已淘汰.

取得或設定值,指出程式碼是否必須具有 Execution 才能執行。

SecurityEnabled
已淘汰.
已淘汰.
已淘汰.

取得或設定值,指出是否啟用安全性。

方法

CurrentThreadRequiresSecurityContextCapture()
已淘汰.

判斷如果稍後必須重新建立目前執行緒的安全性狀態,目前執行緒是否需要擷取安全性內容。

GetStandardSandbox(Evidence)
已淘汰.

取得可安全授與具提供之辨識項的應用程式的權限集合。

GetZoneAndOrigin(ArrayList, ArrayList)
已淘汰.

取得目前組件的已授與區域識別 (Identity) 和 URL 識別使用權限集合。

IsGranted(IPermission)
已淘汰.
已淘汰.

判斷是否授與呼叫端使用權限。

LoadPolicyLevelFromFile(String, PolicyLevelType)
已淘汰.
已淘汰.

從指定的檔案載入 PolicyLevel

LoadPolicyLevelFromString(String, PolicyLevelType)
已淘汰.
已淘汰.

從指定的字串載入 PolicyLevel

PolicyHierarchy()
已淘汰.
已淘汰.

提供依層級存取安全性原則階層的列舉程式,例如電腦原則和使用者原則。

ResolvePolicy(Evidence)
已淘汰.
已淘汰.

根據指定的辨識項,判斷授與程式碼的權限。

ResolvePolicy(Evidence, PermissionSet, PermissionSet, PermissionSet, PermissionSet)
已淘汰.
已淘汰.

根據指定的辨識項和要求,判斷授與程式碼的權限。

ResolvePolicy(Evidence[])
已淘汰.
已淘汰.

根據指定的辨識項,判斷授與程式碼的權限。

ResolvePolicyGroups(Evidence)
已淘汰.
已淘汰.

取得符合指定之辨識項的程式碼群組集合。

ResolveSystemPolicy(Evidence)
已淘汰.
已淘汰.

根據指定的辨識項,判斷要授與程式碼何種權限,但不包括 AppDomain 層級的原則。

SavePolicy()
已淘汰.
已淘汰.

儲存已修改的安全性原則狀態。

SavePolicyLevel(PolicyLevel)
已淘汰.
已淘汰.

儲存使用 LoadPolicyLevelFromFile(String, PolicyLevelType) 載入之已修改的安全性原則層級。

適用於