SecurityManager 類別

定義

提供類別與安全系統互動的主要存取點。 此類別無法獲得繼承。

public ref class SecurityManager sealed
public ref class SecurityManager abstract sealed
public sealed class SecurityManager
[System.Runtime.InteropServices.ComVisible(true)]
public static class SecurityManager
type SecurityManager = class
[<System.Runtime.InteropServices.ComVisible(true)>]
type SecurityManager = class
Public NotInheritable Class SecurityManager
Public Class SecurityManager
繼承
SecurityManager
屬性

備註

注意事項

.NET Framework 和 .NET 的所有版本中,代碼存取安全性(CAS)已被棄用。 最新版本的 .NET 不會接受 CAS 註釋,如果使用 CAS 相關 API,則會產生錯誤。 開發人員應尋求其他方法來完成安全任務。

安全性提供存取及操作安全政策設定的方法。 你無法建立 的 SecurityManager實例。

屬性

名稱 Description
CheckExecutionRights
已淘汰.

取得或設定一個值,表示程式碼執行時必須有的 Execution 條件。

SecurityEnabled
已淘汰.
已淘汰.

取得或設定一個值,指示是否啟用安全。

方法

名稱 Description
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)

適用於