ObfuscationAttribute.StripAfterObfuscation 属性

定义

获取或设置一个 Boolean 值,该值指示模糊处理工具是否应在处理后移除此特性。

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

属性值

如果模糊处理工具应在处理后移除该特性,则为 true;否则为 false。 默认值为 true

示例

下面的代码示例演示 ObfuscationAttributeStripAfterObfuscation 属性为 false 的 ,以便模糊处理工具在模糊处理后不会去除特性。 必须 false 指定 属性以避免 Exclude 从模糊处理中排除 MethodA ,因为 属性 Exclude 的默认值为 true

此代码是可以编译和执行的更大示例的一部分。 请参阅 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

注解

如果库将作为另一个应用程序的一部分包含并作为该应用程序的一部分进行模糊处理,则不应删除属性。

重要

应用此属性不会自动对应用此属性的代码实体进行模糊处理。 应用 属性是为模糊处理工具创建配置文件的替代方法。 也就是说,它只是提供模糊处理工具的说明。 Microsoft 建议模糊处理工具的供应商遵循此处所述的语义。 但是,无法保证特定工具遵循 Microsoft 建议。

适用于