VCFile::Extension Property

 

Gets the extension of a file.

Namespace:   Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

property String^ Extension {
	String^ get();
}

Property Value

Type: System::String^

The extension of a file.

See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

The following example uses the Extension property in the integrated development environment (IDE):

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim idx As Integer
        Dim prj As VCProject
        Dim file As VCFile
        Dim col As IVCCollection
        prj = DTE.Solution.Projects.Item(1).Object
        col = prj.Files
        For idx = 1 To col.Count
            file = col.Item(idx)
            MsgBox(file.Extension)
        Next
    End Sub
End Module
Return to top
Show: