Hello guys,
I’m writing a program that need’s to delete a Folder with the bunch of files witch is not a problem. The problem is how I can check if the file inside the folder is in use or open by another program.
Thank you. :confused:
Printable View
Hello guys,
I’m writing a program that need’s to delete a Folder with the bunch of files witch is not a problem. The problem is how I can check if the file inside the folder is in use or open by another program.
Thank you. :confused:
VB Code:
Try openFile = System.IO.File.Open(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None) Catch fileinuse As System.IO.IOException ' file is in use End Try
Once the above test has been carried out, if the file is not locked, will it then be open by this programme. As such if you want to delete it, you will have to close it first ?