共用方式為


SecurityManager.LoadPolicyLevelFromFile(String, PolicyLevelType) 方法

定義

警告

此 API 現已淘汰。

警告

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

從指定的檔案載入 PolicyLevel

public:
 static System::Security::Policy::PolicyLevel ^ LoadPolicyLevelFromFile(System::String ^ path, System::Security::PolicyLevelType type);
[System.Obsolete]
public static System.Security.Policy.PolicyLevel LoadPolicyLevelFromFile (string path, System.Security.PolicyLevelType type);
public static System.Security.Policy.PolicyLevel LoadPolicyLevelFromFile (string path, System.Security.PolicyLevelType type);
[System.Obsolete("This method is 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 static System.Security.Policy.PolicyLevel LoadPolicyLevelFromFile (string path, System.Security.PolicyLevelType type);
[<System.Obsolete>]
static member LoadPolicyLevelFromFile : string * System.Security.PolicyLevelType -> System.Security.Policy.PolicyLevel
static member LoadPolicyLevelFromFile : string * System.Security.PolicyLevelType -> System.Security.Policy.PolicyLevel
[<System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
static member LoadPolicyLevelFromFile : string * System.Security.PolicyLevelType -> System.Security.Policy.PolicyLevel
Public Shared Function LoadPolicyLevelFromFile (path As String, type As PolicyLevelType) As PolicyLevel

參數

path
String

包含安全性原則資訊之檔案的實體檔案路徑。

type
PolicyLevelType

其中一個列舉值指定要載入的原則層級類型。

傳回

載入的原則層級。

屬性

例外狀況

path 參數為 null

path 參數指定的檔案不存在。

呼叫此方法的程式碼沒有 ControlPolicy

-或-

呼叫此方法的程式碼沒有 Read

-或-

呼叫此方法的程式碼沒有 Write

-或-

呼叫此方法的程式碼沒有 PathDiscovery

此方法使用程式代碼存取安全性 (CAS) 原則,.NET Framework 4 已過時。 若要啟用 CAS 原則對舊版 .NET Framework 的相容性,請使用 <legacyCasPolicy> 項目

適用於