获取与项目项关联的文件的完整路径和名称。
命名空间:  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 不支持索引属性。
参数
- index
 类型:System.Int16
 必选。项目项的文件名索引(从 1 到 FileCount)。
属性值
类型:System.String
一个字符串,它表示与项目项关联的文件的完整路径和名称。
备注
大多数项目项只有一个与其关联的文件,但某些语言中在极少数情况下每个项可以有多个文件。 例如,Visual Basic 和 Visual C#中窗体的 ProjectItem 表示源文件,它可以有另一个项目项,如 .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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。