Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
VB.Net: Getting a file's filename from a string without the extension
From Wiki
Very easy to do when using the System.IO namespace.
- Imports System.IO
- Module Module1
- Sub Main()
- Dim d As DirectoryInfo = New DirectoryInfo("c:\")
- For Each File As FileInfo In d.GetFiles()
- Console.WriteLine(Path.GetFileNameWithoutExtension(File.FullName))
- Next
- Console.ReadLine()
- End Sub
- End Module
The important bit is in the Path.GetFilenNameWithoutExtension part.



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.