HttpServerUtility.CreateObjectFromClsid Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

<SecurityPermissionAttribute(SecurityAction.Demand, UnmanagedCode := True)>
Public Function CreateObjectFromClsid (
	clsid As String
) As Object

Parameters

clsid
Type: System.String

The class identifier of the 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 demonstrates how to use the CreateObjectFromClsid method to create a server instance of a COM object.

Dim ClsidStr As String
Dim MyObject As Object

ClsidStr = "42754580-16b7-11ce-80eb-00aa003d7352"
MyObject = Server.CreateObject(ClsidStr)

.NET Framework
Available since 1.1
Return to top
Show: