HttpServerUtility.CreateObject HttpServerUtility.CreateObject HttpServerUtility.CreateObject HttpServerUtility.CreateObject Method

定義

建立 COM 物件的伺服器執行個體。Creates a server instance of a COM object.

多載

CreateObject(String) CreateObject(String) CreateObject(String) CreateObject(String)

建立物件程式設計識別項 (ProgID) 所識別之 COM 物件的伺服器執行個體。Creates a server instance of a COM object identified by the object's programmatic identifier (ProgID).

CreateObject(Type) CreateObject(Type) CreateObject(Type)

建立以物件類型識別的 COM 物件的伺服器執行個體。Creates a server instance of a COM object identified by the object's type.

CreateObject(String) CreateObject(String) CreateObject(String) CreateObject(String)

建立物件程式設計識別項 (ProgID) 所識別之 COM 物件的伺服器執行個體。Creates a server instance of a COM object identified by the object's programmatic identifier (ProgID).

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 String String String

要建立執行個體的類別或物件類型。The class or type of object to create an instance of.

傳回

新物件。The new object.

例外狀況

無法建立物件的執行個體。An instance of the object could not be created.

範例

下列範例會使用物件的 ProgID,以建立物件。The following example creates an object by using the object's ProgID.

Object MyObject;
MyObject = Server.CreateObject("Acme.Component.3");
   
Dim MyObject As Object
MyObject = Server.CreateObject("Acme.Component.3")
   
另請參閱

CreateObject(Type) CreateObject(Type) CreateObject(Type)

建立以物件類型識別的 COM 物件的伺服器執行個體。Creates a server instance of a COM object identified by the object's type.

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

參數

type
Type Type Type Type

Type,表示要建立的物件。A Type representing the object to create.

傳回

新物件。The new object.

適用於