Public Class Tester Public Shared Sub Main Dim fileDetail As IO.FileInfo fileDetail = My.Computer.FileSystem.GetFileInfo("test.txt") Console.WriteLine(fileDetail.Extension) End SubEnd Class .txt