System.Reflection Namespace

System.Reflection 命名空間 (Namespace) 包含的型別可透過檢查 Managed 程式碼中組件、模組、成員、參數和其他實體 (Entity) 的中繼資料 (Metadata),擷取這些項目的相關資訊。 The System.Reflection namespace contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata. 您也可以使用這些型別管理已載入之型別的執行個體 (Instance),例如連結事件或叫用 (Invoke) 方法。 These types also can be used to manipulate instances of loaded types, for example to hook up events or to invoke methods. 若要動態建立型別,請使用 System.Reflection.Emit 命名空間。 To dynamically create types, use the System.Reflection.Emit namespace.

類別

AmbiguousMatchException

當繫結至成員時所擲回的例外狀況 (Exception) 會產生一個以上符合繫結準則的成員。The exception that is thrown when binding to a member results in more than one member matching the binding criteria. 這個類別無法被繼承。This class cannot be inherited.

Assembly

表示組件 (Assembly),此組件是可重複使用、可控制版本和自我描述的 Common Language Runtime 應用程式建置區塊。Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.

AssemblyAlgorithmIdAttribute

指定要雜湊組件中所有檔案的演算法。Specifies an algorithm to hash all files in an assembly. 這個類別無法被繼承。This class cannot be inherited.

AssemblyCompanyAttribute

定義組件資訊清單的公司名稱自訂屬性。Defines a company name custom attribute for an assembly manifest.

AssemblyConfigurationAttribute

指定組件的組建組態,例如零售或偵錯。Specifies the build configuration, such as retail or debug, for an assembly.

AssemblyCopyrightAttribute

定義組件資訊清單的著作權自訂屬性。Defines a copyright custom attribute for an assembly manifest.

AssemblyCultureAttribute

指定組件所支援的文化特性。Specifies which culture the assembly supports.

AssemblyDefaultAliasAttribute

定義組件資訊清單 (Assembly Manifest) 的易記預設別名 (Alias)。Defines a friendly default alias for an assembly manifest.

AssemblyDelaySignAttribute

指定建立組件 (Assembly) 時不要完整簽署。Specifies that the assembly is not fully signed when created.

AssemblyDescriptionAttribute

提供組件的文字描述。Provides a text description for an assembly.

AssemblyExtensions
AssemblyFileVersionAttribute

指示編譯器使用 Win32 檔案版本資源的指定版本號碼。Instructs a compiler to use a specific version number for the Win32 file version resource. Win32 檔案版本不需要與組件的版本號碼相同。The Win32 file version is not required to be the same as the assembly's version number.

AssemblyFlagsAttribute

為組件 (Assembly) 指定 AssemblyNameFlags 旗標的位元組合,描述 Just-In-Time (JIT) 編譯器選項、組件是否可重定目標,以及組件是否具有完整或 Token 化的公開金鑰 (Public Key)。Specifies a bitwise combination of AssemblyNameFlags flags for an assembly, describing just-in-time (JIT) compiler options, whether the assembly is retargetable, and whether it has a full or tokenized public key. 這個類別無法被繼承。This class cannot be inherited.

AssemblyInformationalVersionAttribute

定義組件資訊清單的其他版本資訊。Defines additional version information for an assembly manifest.

AssemblyKeyFileAttribute

指定檔案的名稱,該檔案包含用來產生強式名稱 (Strong Name) 的金鑰組 (Key Pair)。Specifies the name of a file containing the key pair used to generate a strong name.

AssemblyKeyNameAttribute

指定 CSP 內包含用來產生強式名稱金鑰組的金鑰容器名稱。Specifies the name of a key container within the CSP containing the key pair used to generate a strong name.

AssemblyMetadataAttribute

定義裝飾組件之金鑰/值的中繼資料組。Defines a key/value metadata pair for the decorated assembly.

AssemblyName

完整描述組件的唯一識別。Describes an assembly's unique identity in full.

AssemblyNameProxy

提供 AssemblyName 的可遠端使用版本。Provides a remotable version of the AssemblyName.

AssemblyProductAttribute

定義組件資訊清單 (Assembly Manifest) 的產品名稱自訂屬性 (Attribute)。Defines a product name custom attribute for an assembly manifest.

AssemblySignatureKeyAttribute

從舊的、較簡單的強式名稱金鑰移轉到具有較強的雜湊演算法、較大的金鑰。Provides migration from an older, simpler strong name key to a larger key with a stronger hashing algorithm.

AssemblyTitleAttribute

指定組件的說明。Specifies a description for an assembly.

AssemblyTrademarkAttribute

定義組件資訊清單的商標自訂屬性。Defines a trademark custom attribute for an assembly manifest.

AssemblyVersionAttribute

指定使用屬性之組件的版本。Specifies the version of the assembly being attributed.

Binder

從候選者清單中選取成員,並執行型別轉換,從實質引數 (Actual Argument) 型別轉換成型式引數 (Formal Argument) 型別。Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type.

ConstructorInfo

探索類別建構函式的屬性,並提供建構函式中繼資料的存取。Discovers the attributes of a class constructor and provides access to constructor metadata.

CustomAttributeData

提供已載入至僅限反映內容之組件、模組、類型、成員和參數的自訂屬性資料存取。Provides access to custom attribute data for assemblies, modules, types, members and parameters that are loaded into the reflection-only context.

CustomAttributeExtensions

包含用來擷取自訂屬性的靜態方法。Contains static methods for retrieving custom attributes.

CustomAttributeFormatException

自訂屬性 (Attribute) 的二進位格式無效時所擲回的例外狀況。The exception that is thrown when the binary format of a custom attribute is invalid.

DefaultMemberAttribute

定義 InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]) 所使用之預設成員的型別成員。Defines the member of a type that is the default member used by InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]).

DispatchProxy

提供具現化 Proxy 物件及處理其方法分派的機制。Provides a mechanism for instantiating proxy objects and handling their method dispatch.

EventInfo

探索事件的屬性 (Attribute) 並提供事件中繼資料 (Metadata) 的存取。Discovers the attributes of an event and provides access to event metadata.

EventInfoExtensions
ExceptionHandlingClause

表示結構化例外狀況處理 (Structured Exception Handling) 區塊中的子句。Represents a clause in a structured exception-handling block.

FieldInfo

探索欄位的屬性並提供欄位中繼資料的存取。Discovers the attributes of a field and provides access to field metadata.

IntrospectionExtensions

包含用來轉換 Type 物件的方法。Contains methods for converting Type objects.

InvalidFilterCriteriaException

當篩選準則對於您所使用的篩選器型別無效時,在 FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) 中擲回的例外狀況。The exception that is thrown in FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) when the filter criteria is not valid for the type of filter you are using.

LocalVariableInfo

探索區域變數的屬性 (Attribute),並提供區域變數中繼資料 (Metadata) 的存取。Discovers the attributes of a local variable and provides access to local variable metadata.

ManifestResourceInfo

提供對資訊清單 (Manifest) 資源的存取,資訊清單資源就是描述應用程式相依性的 XML 檔案。Provides access to manifest resources, which are XML files that describe application dependencies.

MemberInfo

取得成員的屬性相關資訊,並提供成員中繼資料的存取。Obtains information about the attributes of a member and provides access to member metadata.

MemberInfoExtensions
MetadataAssemblyResolver
MetadataLoadContext

代表針對僅限檢測目的載入的 Type 物件封閉宇宙。Represents a closed universe of Type objects loaded for inspection-only purposes. 每個 MetadataLoadContext 都可以有它自己的繫結規則,而且它與所有其他 MetadataLoadContext 隔離。Each MetadataLoadContext can have its own binding rules and is isolated from all other MetadataLoadContexts.

MethodBase

提供有關方法和建構函式的資訊。Provides information about methods and constructors.

MethodBody

提供方法主體之中繼資料和 MSIL 的存取。Provides access to the metadata and MSIL for the body of a method.

MethodInfo

探索方法的屬性 (Attribute) 並提供方法中繼資料 (Metadata) 的存取。Discovers the attributes of a method and provides access to method metadata.

MethodInfoExtensions
Missing

表示遺漏的 ObjectRepresents a missing Object. 這個類別無法被繼承。This class cannot be inherited.

Module

在模組上執行反映。Performs reflection on a module.

ModuleExtensions
ObfuscateAssemblyAttribute

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

ObfuscationAttribute

指示模糊化工具針對組件 (Assembly)、型別或成員,採取指定的動作。Instructs obfuscation tools to take the specified actions for an assembly, type, or member.

ParameterInfo

探索參數屬性 (Attribute) 並提供對參數中繼資料 (Metadata) 的存取。Discovers the attributes of a parameter and provides access to parameter metadata.

PathAssemblyResolver
Pointer

提供指標的包裝函式類別。Provides a wrapper class for pointers.

PropertyInfo

探索屬性 (Property) 的屬性 (Attribute),並提供屬性中繼資料 (Metadata) 的存取。Discovers the attributes of a property and provides access to property metadata.

PropertyInfoExtensions
ReflectionContext

表示可提供代表可提供反映物件的內容。Represents a context that can provide reflection objects.

ReflectionTypeLoadException

無法載入模組中的任何類別時,GetTypes() 方法擲回的例外狀況。The exception that is thrown by the GetTypes() method if any of the classes in a module cannot be loaded. 這個類別無法被繼承。This class cannot be inherited.

RuntimeReflectionExtensions

提供用來在執行階段擷取型別資訊的方法。Provides methods that retrieve information about types at run time.

StrongNameKeyPair

封裝公用或私密金鑰組 (用來簽名強式名稱組件) 的存取。Encapsulates access to a public or private key pair used to sign strong name assemblies.

TargetException

代表嘗試叫用無效目標時所擲回的例外狀況。Represents the exception that is thrown when an attempt is made to invoke an invalid target.

TargetInvocationException

透過反映叫用的方法所擲回的例外狀況。The exception that is thrown by methods invoked through reflection. 這個類別無法被繼承。This class cannot be inherited.

TargetParameterCountException

當引動過程的參數數目不符合所預期的數目時,就會擲回例外狀況。The exception that is thrown when the number of parameters for an invocation does not match the number expected. 這個類別無法被繼承。This class cannot be inherited.

TypeDelegator

包裝 Type 物件,並將方法委派 (Delegate) 給該 TypeWraps a Type object and delegates methods to that Type.

TypeExtensions
TypeInfo

代表下列各項的類型宣告:類別類型、介面類型、陣列類型、值類型、列舉類型、型別參數、泛型類型定義,以及開放式或封閉式的建構泛型類型。Represents type declarations for class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.

結構

CustomAttributeNamedArgument

代表在僅限反映的內容中自訂屬性的具名引數。Represents a named argument of a custom attribute in the reflection-only context.

CustomAttributeTypedArgument

表示在僅限反映的內容中自訂屬性 (Attribute) 的引數,或是陣列引數的元素。Represents an argument of a custom attribute in the reflection-only context, or an element of an array argument.

InterfaceMapping

將介面的對應擷取到實作該介面的類別上的實質方法中。Retrieves the mapping of an interface into the actual methods on a class that implements that interface.

ParameterModifier

將修飾詞附加到參數,如此一來,繫結就能與已修改類型的參數簽章一同運作。Attaches a modifier to parameters so that binding can work with parameter signatures in which the types have been modified.

介面

ICustomAttributeProvider

提供自訂屬性以反映支援它們的物件。Provides custom attributes for reflection objects that support them.

ICustomTypeProvider

表示提供自訂型別的物件。Represents an object that provides a custom type.

IReflect

IDispatch 介面交互操作。Interoperates with the IDispatch interface.

IReflectableType

表示可以反映的型別。Represents a type that you can reflect over.

列舉

AssemblyContentType

提供組件所包含的程式碼類型的相關資訊。Provides information about the type of code contained in an assembly.

AssemblyFlags
AssemblyHashAlgorithm
AssemblyNameFlags

提供有關 Assembly 參考的資訊。Provides information about an Assembly reference.

BindingFlags

指定控制繫結的旗標和由反映執行的成員和類型搜尋方式。Specifies flags that control binding and the way in which the search for members and types is conducted by reflection.

CallingConventions

定義方法的有效呼叫慣例 (Calling Convention)。Defines the valid calling conventions for a method.

DeclarativeSecurityAction
EventAttributes

指定事件的屬性。Specifies the attributes of an event.

ExceptionHandlingClauseOptions

識別例外狀況處理 (Exception Handling) 子句的類型。Identifies kinds of exception-handling clauses.

FieldAttributes

指定描述欄位屬性 (Attribute) 的旗標。Specifies flags that describe the attributes of a field.

GenericParameterAttributes

描述泛型類型或方法之泛型型別參數的限制式。Describes the constraints on a generic type parameter of a generic type or method.

ImageFileMachine

識別可執行檔的目標平台。Identifies the platform targeted by an executable.

ManifestResourceAttributes
MemberTypes

將所定義的每一種成員類型標記為 MemberInfo 的衍生類別。Marks each type of member that is defined as a derived class of MemberInfo.

MethodAttributes

指定方法屬性 (Attribute) 的旗標。Specifies flags for method attributes. 這些旗標都被定義在 corhdr.h 檔案中。These flags are defined in the corhdr.h file.

MethodImplAttributes

指定方法實作的屬性旗標。Specifies flags for the attributes of a method implementation.

MethodImportAttributes
MethodSemanticsAttributes
ParameterAttributes

定義可以與參數相關聯的屬性。Defines the attributes that can be associated with a parameter. 這些都在 CorHdr.h 中定義。These are defined in CorHdr.h.

PortableExecutableKinds

識別可執行檔中的程式碼性質。Identifies the nature of the code in an executable file.

ProcessorArchitecture

識別可執行檔之目標平台的處理器以及每個字組的位元 (Bits-per-word)。Identifies the processor and bits-per-word of the platform targeted by an executable.

PropertyAttributes

定義屬性 (Attribute),其可能與屬性 (Property) 有關聯。Defines the attributes that can be associated with a property. 這些屬性 (Attribute) 值都被定義在 corhdr.h 中。These attribute values are defined in corhdr.h.

ResourceAttributes

指定資訊清單資源的屬性 (Attribute)。Specifies the attributes for a manifest resource.

ResourceLocation

指定該資源的位置。Specifies the resource location.

TypeAttributes

指定型別屬性 (Attribute)。Specifies type attributes.

委派

MemberFilter

代表用來篩選成員清單的委派,這些成員為 MemberInfo 物件陣列中代表的成員。Represents a delegate that is used to filter a list of members represented in an array of MemberInfo objects.

ModuleResolveEventHandler

代表將處理 AssemblyModuleResolve 事件之方法。Represents the method that will handle the ModuleResolve event of an Assembly.

TypeFilter

篩選 Type 物件陣列中表示的類別。Filters the classes represented in an array of Type objects.