ObfuscationAttribute.StripAfterObfuscation Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit une Boolean valeur indiquant si l’outil d’obfuscation doit supprimer cet attribut après le traitement.
public:
property bool StripAfterObfuscation { bool get(); void set(bool value); };
public bool StripAfterObfuscation { get; set; }
member this.StripAfterObfuscation : bool with get, set
Public Property StripAfterObfuscation As Boolean
Valeur de propriété
true si un outil d’obfuscation doit supprimer l’attribut après le traitement ; sinon, false. La valeur par défaut est true.
Exemples
L’exemple de code suivant montre une ObfuscationAttribute propriété dont StripAfterObfuscation la propriété est false de sorte que l’outil d’obfuscation ne supprime pas l’attribut après l’obfuscation. Il est nécessaire de spécifier false pour la Exclude propriété d’éviter MethodA l’exclusion de l’obfuscation, car la valeur par défaut de la Exclude propriété est true.
Ce code fait partie d’un exemple plus large qui peut être compilé et exécuté. Consultez la classe ObfuscationAttribute.
[ObfuscationAttribute(Exclude=true, ApplyToMembers=false)]
public class Type2
{
// The exclusion of the type is not applied to its members,
// however in order to mark the member with the "default"
// feature it is necessary to specify Exclude=false,
// because the default value of Exclude is true. The tool
// should not strip this attribute after obfuscation.
[ObfuscationAttribute(Exclude=false, Feature="default",
StripAfterObfuscation=false)]
public void MethodA() {}
// This member is marked for obfuscation, because the
// exclusion of the type is not applied to its members.
public void MethodB() {}
}
<ObfuscationAttribute(Exclude:=True, ApplyToMembers:=False)> _
Public Class Type2
' The exclusion of the type is not applied to its members,
' however in order to mark the member with the "default"
' feature it is necessary to specify Exclude:=False,
' because the default value of Exclude is True. The tool
' should not strip this attribute after obfuscation.
<ObfuscationAttribute(Exclude:=False, _
Feature:="default", StripAfterObfuscation:=False)> _
Public Sub MethodA()
End Sub
' This member is marked for obfuscation, because the
' exclusion of the type is not applied to its members.
Public Sub MethodB()
End Sub
End Class
Remarques
Les attributs ne doivent pas être supprimés si votre bibliothèque sera incluse dans le cadre d’une autre application et masquée dans le cadre de cette application.
Important
L’application de cet attribut n’obfusque pas automatiquement l’entité de code à laquelle vous l’appliquez. L’application de l’attribut est une alternative à la création d’un fichier de configuration pour l’outil d’obfuscation. Autrement dit, il fournit simplement des instructions pour un outil d’obfuscation. Microsoft recommande aux fournisseurs d’outils d’obfuscation de suivre la sémantique décrite ici. Toutefois, il n’existe aucune garantie qu’un outil particulier suit les recommandations de Microsoft.