HttpServerUtility.CreateObject Method (String)

 

Creates a server instance of a COM object identified by the object's programmatic identifier (ProgID).

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
public object CreateObject(
	string progID
)

Parameters

progID
Type: System.String

The class or type of object to create an instance of.

Return Value

Type: System.Object

The new object.

Exception Condition
HttpException

An instance of the object could not be created.

The following example creates an object by using the object's ProgID.

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

.NET Framework
Available since 1.1
Return to top
Show: