共用方式為


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 檔案)原始碼的建置提供者,請從該 BuildProvider 類別衍生出一個類別,並覆寫該 GetGeneratedType 方法以回傳建置提供者產生的型別。

ASP.NET 建置系統會為每個建置提供者編譯檔案,並產生CompilerResults一個物件,該物件會傳給方法。GetGeneratedType 通常,建置提供者GetGeneratedType的實作會利用輸入CompiledAssembly物件屬性results上的方法GetType回傳所提供的型別。

適用於

另請參閱