ProjectItem.FileNames 属性

获取与项目项关联的文件的完整路径和名称。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property FileNames ( _
    index As Short _
) As String
string this[
    short index
] { get; }
property String^ FileNames[[InAttribute] short index] {
    String^ get ([InAttribute] short index);
}
abstract FileNames : 
        index:int16 -> string with get
JScript 不支持索引属性。

参数

  • index
    类型:Int16

    必需。 从 1 到的文件名称的索引FileCount项目项。

属性值

类型:String
表示与项目项关联的文件的完整路径和名称的字符串。

备注

大多数项目项具有与其相关联的只有一个文件,但某些语言中偶尔可能会发生每个项目的多个文件。 例如,ProjectItem中窗体Visual Basic和Visual C#表示源代码文件,可以有另一个项目项 (例如.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 命名空间

其他资源

控制项目和解决方案