Marshal.GenerateProgIdForType(Type) 方法

定义

返回指定类型的编程标识符 (ProgID)。

public:
 static System::String ^ GenerateProgIdForType(Type ^ type);
public static string? GenerateProgIdForType (Type type);
public static string GenerateProgIdForType (Type type);
[System.Security.SecurityCritical]
public static string GenerateProgIdForType (Type type);
static member GenerateProgIdForType : Type -> string
[<System.Security.SecurityCritical>]
static member GenerateProgIdForType : Type -> string
Public Shared Function GenerateProgIdForType (type As Type) As String

参数

type
Type

要获取其 ProgID 的类型。

返回

String

指定类型的 ProgID。

属性

例外

type 参数不是由 COM 创建的类。 该类必须是公共的,必须具有公共的无参数构造函数,而且必须是 COM 可见的。

type 参数为 null

注解

如果类型在元数据中具有 ProgID,则返回该 ProgID。 否则,将根据类型的完全限定名称生成 ProgID。

适用于