共用方式為


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 的 ,因此模糊化工具不會在模糊化之後移除屬性。 您必須為 屬性指定 falseExclude ,以避免從模糊化排除 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 建議。

適用於