ObfuscateAssemblyAttribute 類別

定義

指示模糊化工具針對適當的組件 (Assembly) 型別,使用它們的標準模糊化規則。Instructs obfuscation tools to use their standard obfuscation rules for the appropriate assembly type.

public ref class ObfuscateAssemblyAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ObfuscateAssemblyAttribute : Attribute
type ObfuscateAssemblyAttribute = class
    inherit Attribute
Public NotInheritable Class ObfuscateAssemblyAttribute
Inherits Attribute
繼承
ObfuscateAssemblyAttribute
屬性

範例

下列程式碼範例顯示已使用標記的私用ObfuscateAssemblyAttribute元件。The following code example shows a private assembly that has been marked with the ObfuscateAssemblyAttribute. StripAfterObfuscation屬性為false, 以防止模糊化工具在處理後去除屬性。The StripAfterObfuscation property is false, to prevent the obfuscation tool from stripping the attribute after processing.

如需示範如何搭配使用的ObfuscateAssemblyAttribute ObfuscationAttribute程式碼範例, 請參閱ObfuscationAttribute類別。For a code example that shows the use of ObfuscateAssemblyAttribute with ObfuscationAttribute, see the ObfuscationAttribute class.

using System;
using System.Reflection;

[assembly: ObfuscateAssemblyAttribute(true, 
    StripAfterObfuscation=false)]
Imports System.Reflection

<Assembly: ObfuscateAssemblyAttribute(False, _
    StripAfterObfuscation:=False)>

備註

ObfuscationAttributeObfuscateAssemblyAttribute屬性提供一種方法, 讓元件作者可以標注其二進位檔, 讓混淆工具能夠使用最少的外部設定正確處理它們。The ObfuscationAttribute and ObfuscateAssemblyAttribute attributes provide a way for assembly authors to annotate their binaries so that obfuscation tools can process them correctly with minimal external configuration.

將這個屬性套用至元件, 會告訴混淆工具使用它的預設規則做為元件類型。Applying this attribute to an assembly tells the obfuscation tool to use its default rules for the assembly type.

重要

套用這個屬性並不會自動模糊處理元件。Applying this attribute does not automatically obfuscate the assembly. 套用屬性是建立模糊化工具之設定檔的替代方法。Applying the attribute is an alternative to creating a configuration file for the obfuscation tool. 也就是說, 它只提供模糊化工具的指示。That is, it merely provides instructions for an obfuscation tool. Microsoft 建議混淆工具的廠商遵循這裡所述的語法。Microsoft recommends that vendors of obfuscation tools follow the semantics described here. 不過, 並不保證特定工具會遵循 Microsoft 建議。However, there is no guarantee that a particular tool follows Microsoft recommendations.

您可以將ObfuscationAttribute套用至元件內的類型, 以及這些類型的成員。You can apply ObfuscationAttribute to types within an assembly, and to members on those types. 最內層的屬性控制模糊化工具處理任何特定程式碼實體的方式。The innermost attribute controls the way an obfuscation tool treats any particular code entity.

建構函式

ObfuscateAssemblyAttribute(Boolean)

初始化 ObfuscateAssemblyAttribute 類別的新執行個體,並指定要模糊化的組件是公用或私用。Initializes a new instance of the ObfuscateAssemblyAttribute class, specifying whether the assembly to be obfuscated is public or private.

屬性

AssemblyIsPrivate

取得 Boolean 值,指出組件是否標記為私用。Gets a Boolean value indicating whether the assembly was marked private.

StripAfterObfuscation

取得或設定 Boolean 值,指出模糊化工具是否應該在進行處理後移除屬性。Gets or sets a Boolean value indicating whether the obfuscation tool should remove the attribute after processing.

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。When implemented in a derived class, gets a unique identifier for this Attribute.

(繼承來源 Attribute)

方法

Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。Returns a value that indicates whether this instance is equal to a specified object.

(繼承來源 Attribute)
GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

(繼承來源 Attribute)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

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

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can be used to get the type information for an interface.

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

(繼承來源 Attribute)

適用於

另請參閱