共用方式為


VSWebSite.AddFromTemplate 方法

在網站專案中建立新的 ProjectItem

命名空間:  VsWebSite
組件:  VsWebSite.Interop (在 VsWebSite.Interop.dll 中)

語法

'宣告
Function AddFromTemplate ( _
    bstrRelFolderUrl As String, _
    bstrWizardName As String, _
    bstrLanguage As String, _
    bstrItemName As String, _
    bUseCodeSeparation As Boolean, _
    bstrMasterPage As String, _
    bstrDocType As String _
) As ProjectItem
ProjectItem AddFromTemplate(
    string bstrRelFolderUrl,
    string bstrWizardName,
    string bstrLanguage,
    string bstrItemName,
    bool bUseCodeSeparation,
    string bstrMasterPage,
    string bstrDocType
)
ProjectItem^ AddFromTemplate(
    [InAttribute] String^ bstrRelFolderUrl, 
    [InAttribute] String^ bstrWizardName, 
    [InAttribute] String^ bstrLanguage, 
    [InAttribute] String^ bstrItemName, 
    [InAttribute] bool bUseCodeSeparation, 
    [InAttribute] String^ bstrMasterPage, 
    [InAttribute] String^ bstrDocType
)
abstract AddFromTemplate : 
        bstrRelFolderUrl:string * 
        bstrWizardName:string * 
        bstrLanguage:string * 
        bstrItemName:string * 
        bUseCodeSeparation:bool * 
        bstrMasterPage:string * 
        bstrDocType:string -> ProjectItem 
function AddFromTemplate(
    bstrRelFolderUrl : String, 
    bstrWizardName : String, 
    bstrLanguage : String, 
    bstrItemName : String, 
    bUseCodeSeparation : boolean, 
    bstrMasterPage : String, 
    bstrDocType : String
) : ProjectItem

參數

  • bstrRelFolderUrl
    型別:System.String
    要在其中建立 ProjectItem 物件之資料夾的相對 URL。如果這個參數為 nullNull 參照 (即 Visual Basic 中的 Nothing) 或空字串,就會將項目加入至專案的根目錄。
  • bUseCodeSeparation
    型別:System.Boolean
    布林值 (Boolean),指出是否要使用程式碼後置 (Code-Behind) 模型。只有當專案支援程式碼後置的檔案時,才會使用這個參數,否則就會加以忽略。
  • bstrMasterPage
    型別:System.String
    支援主版頁面 (Master Page) 之專案主版頁面的相對路徑和名稱,以及範本 (如果適用的話),否則就會忽略此參數。

傳回值

型別:EnvDTE.ProjectItem
ProjectItem 物件。

.NET Framework 安全性

請參閱

參考

VSWebSite 介面

VsWebSite 命名空間

EnvDTE

EnvDTE80

DTE2

其他資源

參考 Automation 組件和 DTE2 物件

Finding and Sharing Project and Item Templates