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: deleting a file
From Wiki
Very simple when using system.IO
put it in a try catch block because this can backfire in a winows environment. in linux you can just delete everything without it complaining ;-).
- Imports System.IO
- Module Module1
- Sub Main()
- Try
- File.Delete("c:/file.txt")
- Catch ex As Exception
- Console.WriteLine("the file could not be deleted for the following reason:" & ex.Message)
- End Try
- End Sub
- End Module



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