ProjectItem.FileNames[Int16] Property

Definition

Gets the full path and names of the files associated with a project item.

public:
 property System::String ^ FileNames[short] { System::String ^ get(short index); };
[System.Runtime.InteropServices.DispId(11)]
[get: System.Runtime.InteropServices.DispId(11)]
public string FileNames[short index] { 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

Parameters

index
Int16

Required. The index of file names from 1 to FileCount for the project item.

Property Value

String

A string representing the full path and names of the files associated with a project item.

Attributes

Examples

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  

Remarks

Most project items have only one file associated with them, but some languages can occasionally have multiple files per item. For example, a ProjectItem for a form in Visual Basic and Visual C# represents the source file, which can have another project item such as a .resx file.

When the project item's ProjectItems property has a value, and the ProjectItem object represents a filter folder on the disk, then the FileNames[] property returns only the name of the filter folder.

Applies to