Share via


HttpServerUtility.CreateObject 方法

定義

建立 COM 物件的伺服器執行個體。

多載

CreateObject(String)

建立物件程式設計識別項 (ProgID) 所識別之 COM 物件的伺服器執行個體。

CreateObject(Type)

建立以物件類型識別的 COM 物件的伺服器執行個體。

CreateObject(String)

建立物件程式設計識別項 (ProgID) 所識別之 COM 物件的伺服器執行個體。

public:
 System::Object ^ CreateObject(System::String ^ progID);
public object CreateObject (string progID);
member this.CreateObject : string -> obj
Public Function CreateObject (progID As String) As Object

參數

progID
String

要建立執行個體的類別或物件類型。

傳回

新物件。

例外狀況

無法建立物件的執行個體。

範例

下列範例會使用 物件的 ProgID 來建立 物件。

Object MyObject;
MyObject = Server.CreateObject("Acme.Component.3");

Dim MyObject As Object
MyObject = Server.CreateObject("Acme.Component.3")
   

另請參閱

適用於

CreateObject(Type)

建立以物件類型識別的 COM 物件的伺服器執行個體。

public:
 System::Object ^ CreateObject(Type ^ type);
public object CreateObject (Type type);
member this.CreateObject : Type -> obj
Public Function CreateObject (type As Type) As Object

參數

type
Type

Type,表示要建立的物件。

傳回

新物件。

適用於