Share via


VCFile.Extension Property

Definition

Gets the extension of a file.

public:
 property System::String ^ Extension { System::String ^ get(); };
public:
 property Platform::String ^ Extension { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(407)]
public string Extension { [System.Runtime.InteropServices.DispId(407)] get; }
[<System.Runtime.InteropServices.DispId(407)>]
[<get: System.Runtime.InteropServices.DispId(407)>]
member this.Extension : string
Public ReadOnly Property Extension As String

Property Value

The extension of a file.

Attributes

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  

Remarks

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

Applies to