Get file extension name : FileInfo « Stream File « VB.Net Tutorial






Public Class Tester
    Public Shared Sub Main
    
        Dim fileDetail As IO.FileInfo


        fileDetail = My.Computer.FileSystem.GetFileInfo("test.txt")

        Console.WriteLine(fileDetail.Extension)
    End Sub

End Class
.txt








13.4.FileInfo
13.4.1.My.Computer.FileSystem.GetFileInfo(''File Name'')
13.4.2.FileInfo.IsReadOnly, FileAttributes.Hidden
13.4.3.Set file attributes: Hidden, ReadOnly
13.4.4.Get File Attributes as a string
13.4.5.Get file Creation Time, Last Access Time and Modified Time
13.4.6.Get file size
13.4.7.Get file extension name