How To Delete a File in VB.NET
In this article I describe how to delete a file using VB.NET.
Delete a File in VB.NET
The Delete method deletes the specified file permanently.
Suppose you want to delete a file at location C:\Temp\Data\MaheshTXMoved.txt.
The following code snippet deletes a file
Dim fileName As String = "C:\Temp\Data\MaheshTXMoved.txt"
Dim fi As New IO.FileInfo(fileName)
Catch iox As IOException