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 的類型。

傳回

指定類型的 ProgID。

屬性

例外狀況

type 參數並不是一個可以使用 COM 來建立的類別。 類別必須為公開、具有公開的無參數建構函式,並對 COM 為可見的。

type 參數為 null

備註

如果類型在中繼資料中有 ProgID,則會傳回該 ProgID。 否則,會根據型別的完整名稱產生 ProgID。

適用於