ClientBuildManager.CreateObject(Type, Boolean) 方法

定义

在 ASP.NET 运行时的应用程序域中创建一个对象。Creates an object in the application domain of the ASP.NET runtime.

public:
 System::Web::Hosting::IRegisteredObject ^ CreateObject(Type ^ type, bool failIfExists);
public System.Web.Hosting.IRegisteredObject CreateObject (Type type, bool failIfExists);
member this.CreateObject : Type * bool -> System.Web.Hosting.IRegisteredObject
Public Function CreateObject (type As Type, failIfExists As Boolean) As IRegisteredObject

参数

type
Type

要创建的对象的类型。The type of object to be created.

failIfExists
Boolean

如果已在 ASP.NET 运行时的应用程序域中创建了对象,则为 true 以引发异常;否则为 falsetrue to throw an exception if the object has already been created in the application domain of the ASP.NET runtime; otherwise, false.

返回

在 ASP.NET 运行时的应用程序域中的一个对象。An object in the application domain of the ASP.NET runtime.

例外

typenulltype is null.

对象已存在于应用程序域中,且 failIfExiststrueThe object already exists in the application domain and failIfExists is true.

适用于

另请参阅