Compartir a través de


VCFile.Extension Property

Gets the extension of a file.

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

Syntax

'Declaration
ReadOnly Property Extension As String
string Extension { get; }
property String^ Extension {
    String^ get ();
}
abstract Extension : string with get
function get Extension () : String

Property Value

Type: System.String
The extension of a file.

Remarks

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

Examples

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

.NET Framework Security

See Also

Reference

VCFile Interface

Microsoft.VisualStudio.VCProjectEngine Namespace