The DeleteFile method of the My.Computer.FileSystem object allows you to delete a file. Among the options it offers are: whether to send the deleted file to the Recycle Bin, whether to ask the user to confirm that the file should be deleted, and what to do when the user cancels the operation.
To delete a text file
To delete a text file and ask the user to confirm that the file should be deleted
To delete a text file and send it to the Recycle Bin
Robust Programming
The following conditions may cause an exception:
See Also