Share via


BuildProvider.GetGeneratedType(CompilerResults) 方法

定義

傳回組建提供者從虛擬路徑產生的型別。

public:
 virtual Type ^ GetGeneratedType(System::CodeDom::Compiler::CompilerResults ^ results);
public virtual Type GetGeneratedType (System.CodeDom.Compiler.CompilerResults results);
abstract member GetGeneratedType : System.CodeDom.Compiler.CompilerResults -> Type
override this.GetGeneratedType : System.CodeDom.Compiler.CompilerResults -> Type
Public Overridable Function GetGeneratedType (results As CompilerResults) As Type

參數

results
CompilerResults

組建提供者之虛擬路徑的編譯結果。

傳回

組建提供者為虛擬路徑產生的型別。 基底類別會傳回 null

備註

若要實作產生 .aspx 檔案等 Web 內容的原始程式碼的組建提供者,請從 BuildProvider 類別衍生類別,並覆寫 GetGeneratedType 方法以傳回組建提供者所產生的類型。

ASP.NET 建置系統會編譯每個組建提供者的檔案,並產生 CompilerResults 物件,該物件會傳遞至 GetGeneratedType 方法。 一般而言,組建提供者的實作 GetGeneratedType 會在 GetType 輸入 results 物件的 屬性上使用 CompiledAssembly 方法,以傳回提供的型別。

適用於

另請參閱