共用方式為


BuildProvider.VirtualPath 屬性

定義

代表此建置提供者實作將建立的檔案。

protected public:
 property System::String ^ VirtualPath { System::String ^ get(); };
protected internal string VirtualPath { get; }
member this.VirtualPath : string
Protected Friend ReadOnly Property VirtualPath As String

屬性值

一個唯讀字串,用來指定此建置提供者要編譯的檔案虛擬路徑。

備註

物件的 BuildProvider 虛擬路徑是建置提供者正在編譯檔案的路徑。 例如,如果你設定了一個 BuildProvider 自訂類別來建立網站中所有檔案,副檔名為 .abc,且網站名稱為 WebSite1,且網站包含名為 Example.abc 的檔案,該 VirtualPath 屬性包含值 /WebSite1/Example.abc

應用程式中每個檔案的副檔名決定了檔案類型,以及該檔案類型的對應建置提供者。 ASP.NET 建置環境會根據檔案類型初始化每個檔案的 BuildProvider 物件,並利用這些 BuildProvider 方法產生每個檔案的原始碼。

欲了解更多關於配置建置提供者的資訊,請參閱 buildProviders 元素以進行編譯(ASP.NET 設定結構)。

適用於

另請參閱