語言

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.

從指定的檔案載入 a 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 框架,請使用 <legacyCasPolicy> 元素。

適用於