共用方式為


ProjectItem.FileNames 屬性

取得與專案項目相關的檔案完整路徑和檔名。

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

語法

'宣告
ReadOnly Property FileNames ( _
    index As Short _
) As String
    Get
string this[
    short index
] { get; }
property String^ FileNames[[InAttribute] short index] {
    String^ get ([InAttribute] short index);
}
abstract FileNames : string
JScript 不支援索引屬性。

參數

屬性值

型別:System.String
代表與專案項目關聯檔案完整路徑和檔名的字串。

備註

大部分專案項目只有一個檔案與其關聯,但部分語言的項目有時可以有多個檔案。 例如,Visual Basic 和 Visual C# 表單中的 ProjectItem 代表原始程式檔 (Source File),可以擁有其他像 .resx 檔案的專案項目。

專案項目的 ProjectItems 屬性有一個值,而且 ProjectItem 物件代表磁碟上的篩選器資料夾時,FileNames 屬性只會傳回篩選資料夾的名稱。

範例

Sub FileNamesExample()
   Dim proj As Project
   Dim projitems As ProjectItems

   ' Reference the current solution and its projects and project items.
   proj = DTE.ActiveSolutionProjects(0)
   projitems = proj.ProjectItems

   ' List the file name associated with the first project item.
   MsgBox(projitems.Item(1).FileNames(1))
End Sub

.NET Framework 安全性

請參閱

參考

ProjectItem 介面

EnvDTE 命名空間

其他資源

控制專案與方案