Hi,
Thanks for posting in the community.
First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you are sweeping a folder on local
machine and the folder will be an ftp directory, that is to say, other
person will remotely upload file to this directory.
You wants to know if some of the files are in use.(e.g. a file is being
uploaded and it did not complete when you are scanning the directory)
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.
I think you may try to open the file which you wants to detect as
FileShare.None, if you get exception and parse the error message, we will
know that the file is being used by another process.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
File.Open("C:\Inetpub\ftproot\Win03.GHO", FileMode.Open,
FileAccess.ReadWrite, FileShare.None)
Catch ex As Exception
MsgBox(ex.Message())
End Try
End Sub
Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.