ProjectItem.FileNames[Int16] 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与项目项关联的文件的完整路径和名称。
public:
property System::String ^ FileNames[short] { System::String ^ get(short index); };
[System.Runtime.InteropServices.DispId(11)]
public string FileNames[short index] { [System.Runtime.InteropServices.DispId(11)] get; }
[<System.Runtime.InteropServices.DispId(11)>]
[<get: System.Runtime.InteropServices.DispId(11)>]
member this.FileNames(int16) : string
Public ReadOnly Property FileNames(index As Short) As String
参数
属性值
表示与项目项关联的文件的完整路径和名称的字符串。
- 属性
示例
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
注解
大多数项目项仅有一个与之关联的文件,但某些语言有时每个项都有多个文件。 例如, ProjectItem 用于和的中的窗 Visual Basic 体 Visual C# 表示源文件,该文件可以有另一个项目项(如 .resx 文件)。
当项目项的 ProjectItems 属性具有值并且 ProjectItem 对象表示磁盘上的筛选器文件夹时, FileNames[] 属性将仅返回筛选器文件夹的名称。