FileDialogPermissionAttribute Classe

Définition

Attention

Code Access Security is not supported or honored by the runtime.

Permet d’appliquer les actions de sécurité de FileDialogPermission au code à l’aide de la sécurité déclarative. Cette classe ne peut pas être héritée.

public ref class FileDialogPermissionAttribute sealed : System::Security::Permissions::CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class FileDialogPermissionAttribute
Inherits CodeAccessSecurityAttribute
Héritage
Attributs

Exemples

L’exemple de code suivant montre comment demander que le code appelant ait FileDialogPermission. Les demandes sont généralement effectuées dans les bibliothèques managées (DLL) pour aider à protéger les méthodes ou les classes contre le code potentiellement dangereux.

[FileDialogPermissionAttribute(SecurityAction::Demand,Unrestricted=true)]
[FileDialogPermissionAttribute(SecurityAction.Demand, Unrestricted=true)]
<FileDialogPermissionAttribute(SecurityAction.Demand, _
 Unrestricted := True)> Public Class SampleClass

Remarques

Important

Le code partiellement approuvé n’est plus pris en charge. Cet attribut n’a aucun effet dans .NET Core.

L’étendue de la déclaration autorisée dépend de celle SecurityAction utilisée.

Les informations de sécurité déclarées par un attribut de sécurité sont stockées dans les métadonnées de la cible d’attribut et sont accessibles par le système au moment de l’exécution. Les attributs de sécurité sont utilisés uniquement pour la sécurité déclarative. Pour la sécurité impérative, utilisez la classe d’autorisation correspondante.

Constructeurs

FileDialogPermissionAttribute(SecurityAction)

Initialise une nouvelle instance de la classe FileDialogPermissionAttribute avec le SecurityAction spécifié.

Propriétés

Action

Obtient ou définit une action de sécurité.

(Hérité de SecurityAttribute)
Open

Obtient ou définit une valeur indiquant si l'autorisation d'ouverture des fichiers par l'intermédiaire de la boîte de dialogue Fichier est déclarée.

Save

Obtient ou définit une valeur indiquant si l'autorisation d'enregistrer des fichiers par l'intermédiaire de la boîte de dialogue Fichier est déclarée.

TypeId

Lors de l'implémentation dans une classe dérivée, obtient un identificateur unique pour l'objet Attribute.

(Hérité de Attribute)
Unrestricted

Obtient ou définit une valeur indiquant si l'autorisation complète (sans restriction) d'accès à la ressource protégée par l'attribut est déclarée.

(Hérité de SecurityAttribute)

Méthodes

CreatePermission()

Crée et retourne un nouveau FileDialogPermission.

Equals(Object)

Retourne une valeur qui indique si cette instance est égale à un objet spécifié.

(Hérité de Attribute)
GetHashCode()

Retourne le code de hachage de cette instance.

(Hérité de Attribute)
GetType()

Obtient le Type de l'instance actuelle.

(Hérité de Object)
IsDefaultAttribute()

En cas de substitution dans une classe dérivée, indique si la valeur de cette instance est la valeur par défaut pour la classe dérivée.

(Hérité de Attribute)
Match(Object)

En cas de substitution dans une classe dérivée, retourne une valeur indiquant si cette instance équivaut à un objet spécifié.

(Hérité de Attribute)
MemberwiseClone()

Crée une copie superficielle du Object actuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l'objet actuel.

(Hérité de Object)

Implémentations d’interfaces explicites

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mappe un jeu de noms avec un jeu correspondant d'identificateurs de dispatch.

(Hérité de Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Récupère les informations de type pour un objet, qui peuvent être utilisées pour obtenir les informations de type d'une interface.

(Hérité de Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Récupère le nombre d'interfaces d'informations de type fourni par un objet (0 ou 1).

(Hérité de Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fournit l'accès aux propriétés et aux méthodes exposées par un objet.

(Hérité de Attribute)

S’applique à

Voir aussi