Share via


SecurityManager.LoadPolicyLevelFromFile(String, PolicyLevelType) Méthode

Définition

Attention

Cette API est à présent déconseillée.

Attention

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.

Charge un PolicyLevel à partir du fichier spécifié.

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

Paramètres

path
String

Le chemin d’accès physique vers un fichier contenant les informations de stratégie de sécurité.

type
PolicyLevelType

Une des valeurs d’énumération qui spécifie le type du niveau de stratégie à charger.

Retours

Le niveau de stratégie chargé.

Attributs

Exceptions

Le paramètre path a la valeur null.

Le fichier indiqué par le paramètre path n’existe pas.

Le code qui appelle cette méthode ne dispose pas de ControlPolicy.

-ou-

Le code qui appelle cette méthode ne dispose pas de Read.

-ou-

Le code qui appelle cette méthode ne dispose pas de Write.

-ou-

Le code qui appelle cette méthode ne dispose pas de PathDiscovery.

Cette méthode utilise la stratégie de sécurité d’accès du code (CAS), qui est obsolète dans .NET Framework 4. Pour activer la stratégie de sécurité d’accès du code (CAS) pour la compatibilité avec les versions antérieures de .NET Framework, utilisez l’élément <legacyCasPolicy>.

S’applique à