共用方式為


_Solution.TemplatePath 屬性

取得目錄的完整路徑和名稱,包含所指定之專案類型的範本。

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

語法

'宣告
ReadOnly Property TemplatePath ( _
    ProjectType As String _
) As String
string this[
    string ProjectType
] { get; }
property String^ TemplatePath[[InAttribute] String^ ProjectType] {
    String^ get ([InAttribute] String^ ProjectType);
}
abstract TemplatePath : 
        ProjectType:string -> string with get
JScript 不支援索引屬性。

參數

  • ProjectType
    類型:String

    必要項。 可以透過 PrjKind 識別專案類型的 GUID。

屬性值

類型:String
目錄的完整路徑和名稱,此目錄包含指定專案類型的範本。

備註

例如,TemplatePath(vsVBProjectKind) 會傳回路徑 <Visual Studio root installation directory>\VBProjects。

TemplatePathProjectItemsTemplatePath 相似,只除了前者是針對專案而非範本。

範例

Sub TemplatePathExample()
   ' Open a Visual Basic solution before running this example.
   Dim soln As Solution

   ' Create a reference to the solution.
   soln = DTE.Solution

   ' List the path to the templates for the project type.
   MsgBox(soln.TemplatePath(DTE.Solution.Item(1).Kind))
End Sub

.NET Framework 安全性

請參閱

參考

_Solution 介面

EnvDTE 命名空間