ObfuscateAssemblyAttribute 类

定义

指示模糊处理工具对适当的程序集类型使用其标准模糊处理规则。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()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

显式界面实现

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

将一组名称映射为对应的一组调度标识符。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)

适用于

另请参阅