SecurityManager.LoadPolicyLevelFromFile(String, PolicyLevelType) Method
Definition
Warning
This API is now obsolete.
Loads a PolicyLevel from the specified file.
public:
static System::Security::Policy::PolicyLevel ^ LoadPolicyLevelFromFile(System::String ^ path, System::Security::PolicyLevelType type);
[System.Obsolete]
[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);
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.
Security
SecurityPermission
for the ability to view and modify policy. Associated enumeration: ControlPolicy
FileIOPermission
for reading and writing files. Associated enumerations: Read, Write, PathDiscovery