ClientBuildManager.CreateObject(Type, Boolean) 方法

定義

在 ASP.NET 執行階段的應用程式定義域中建立物件。

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

要建立的物件類型。

failIfExists
Boolean

如果物件已在 ASP.NET 執行階段的應用程式定義域中建立時,要擲回例外狀況 (Exception) 則為 true,否則為 false

傳回

IRegisteredObject

在 ASP.NET 執行階段的應用程式定義域中的物件。

例外狀況

typenull

物件已經存在於應用程式定義域中,且 failIfExiststrue

適用於

另請參閱