RegistrationServices RegistrationServices RegistrationServices RegistrationServices Class

定义

提供一组用于注册和注销托管程序集以供从 COM 使用的服务。Provides a set of services for registering and unregistering managed assemblies for use from COM.

public ref class RegistrationServices : System::Runtime::InteropServices::IRegistrationServices
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.Guid("475e398f-8afa-43a7-a3be-f4ef8d6787c9")]
[System.Runtime.InteropServices.Guid("475E398F-8AFA-43a7-A3BE-F4EF8D6787C9")]
public class RegistrationServices : System.Runtime.InteropServices.IRegistrationServices
type RegistrationServices = class
    interface IRegistrationServices
Public Class RegistrationServices
Implements IRegistrationServices
继承
RegistrationServicesRegistrationServicesRegistrationServicesRegistrationServices
属性
实现

注解

当在一个程序集的对象正在使用的 COM 客户端时,需要注册。Registration is needed when the objects within an assembly are being used by COM clients. Regasm.exe (程序集注册工具)Microsoft Visual Studio 2005Microsoft Visual Studio 2005公开的方法RegistrationServices类来添加或删除支持 COM 的注册表项的托管程序集。The Regasm.exe (Assembly Registration Tool) and Microsoft Visual Studio 2005Microsoft Visual Studio 2005 use methods exposed by the RegistrationServices class to add or remove COM-enabling registry entries for managed assemblies.

可以使用以下方法来帮助您准备注册文件:You can use the following methods to assist you in preparing a registration file:

尽管这些方法中收集的信息帮助注册文件中使用,但它们不实际生成注册文件。Although these methods help in gathering information to be used in a registration file, they do not actually produce a registration file. 相反,可以使用Regasm.exe (程序集注册工具)工具用于/regfile选项来执行此任务。Instead, you can use the Regasm.exe (Assembly Registration Tool) tool with the /regfile option to perform this task. RegistrationServices 方法不能导出并注册类型库。RegistrationServices methods cannot export and register a type library. 若要导出并注册类型库,可以使用Regasm.exe (程序集注册工具)工具并Tlbexp.exe (类型库导出程序)工具。To export and register a type library, you can use the Regasm.exe (Assembly Registration Tool) tool and the Tlbexp.exe (Type Library Exporter) tool.

构造函数

RegistrationServices() RegistrationServices() RegistrationServices() RegistrationServices()

初始化 RegistrationServices 类的新实例。Initializes a new instance of the RegistrationServices class.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetManagedCategoryGuid() GetManagedCategoryGuid() GetManagedCategoryGuid() GetManagedCategoryGuid()

返回包含托管类的 COM 类别的 GUID。Returns the GUID of the COM category that contains the managed classes.

GetProgIdForType(Type) GetProgIdForType(Type) GetProgIdForType(Type) GetProgIdForType(Type)

检索指定类型的 COM ProgID。Retrieves the COM ProgID for the specified type.

GetRegistrableTypesInAssembly(Assembly) GetRegistrableTypesInAssembly(Assembly) GetRegistrableTypesInAssembly(Assembly) GetRegistrableTypesInAssembly(Assembly)

在通过调用 RegisterAssembly(Assembly, AssemblyRegistrationFlags) 注册的程序集中检索类的列表。Retrieves a list of classes in an assembly that would be registered by a call to RegisterAssembly(Assembly, AssemblyRegistrationFlags).

GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterAssembly(Assembly, AssemblyRegistrationFlags) RegisterAssembly(Assembly, AssemblyRegistrationFlags) RegisterAssembly(Assembly, AssemblyRegistrationFlags) RegisterAssembly(Assembly, AssemblyRegistrationFlags)

注册托管程序集中的类以便能从 COM 创建。Registers the classes in a managed assembly to enable creation from COM.

RegisterTypeForComClients(Type, Guid) RegisterTypeForComClients(Type, Guid) RegisterTypeForComClients(Type, Guid) RegisterTypeForComClients(Type, Guid)

使用指定的 GUID 向 COM 注册指定的类型。Registers the specified type with COM using the specified GUID.

RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType)

使用指定的执行上下文和连接类型向 COM 注册指定的类型。Registers the specified type with COM using the specified execution context and connection type.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
TypeRepresentsComType(Type) TypeRepresentsComType(Type) TypeRepresentsComType(Type) TypeRepresentsComType(Type)

指示类型是否用 ComImportAttribute 进行了标记,或者派生带有 ComImportAttribute 标记的类型并且与父级具有相同的 GUID。Indicates whether a type is marked with the ComImportAttribute, or derives from a type marked with the ComImportAttribute and shares the same GUID as the parent.

TypeRequiresRegistration(Type) TypeRequiresRegistration(Type) TypeRequiresRegistration(Type) TypeRequiresRegistration(Type)

确定指定的类型是否需要注册。Determines whether the specified type requires registration.

UnregisterAssembly(Assembly) UnregisterAssembly(Assembly) UnregisterAssembly(Assembly) UnregisterAssembly(Assembly)

注销托管程序集中的类。Unregisters the classes in a managed assembly.

UnregisterTypeForComClients(Int32) UnregisterTypeForComClients(Int32) UnregisterTypeForComClients(Int32) UnregisterTypeForComClients(Int32)

移除对使用 RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) 方法注册的类型的引用。Removes references to a type registered with the RegisterTypeForComClients(Type, RegistrationClassContext, RegistrationConnectionType) method.

适用于

另请参阅