Editare

Partajați prin


SecurityManager.LoadPolicyLevelFromFile(String, PolicyLevelType) Method

Definition

Caution

This API is now deprecated.

Caution

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.

Loads a PolicyLevel from the specified file.

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

Parameters

path
String

The physical file path to a file containing the security policy information.

type
PolicyLevelType

One of the enumeration values that specifies the type of the policy level to be loaded.

Returns

The loaded policy level.

Attributes

Exceptions

The path parameter is null.

The file indicated by the path parameter does not exist.

The code that calls this method does not have ControlPolicy.

-or-

The code that calls this method does not have Read.

-or-

The code that calls this method does not have Write.

-or-

The code that calls this method does not have PathDiscovery.

This method uses code access security (CAS) policy, which is obsolete in the .NET Framework 4. To enable CAS policy for compatibility with earlier versions of the .NET Framework, use the <legacyCasPolicy> element.

Applies to