Private Function IsFileInUse(ByVal fileName As String) As Boolean
Try
Dim fs As System.IO.FileStream
fs = New FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
fs.Close()
Return False
Catch ex As Exception
Return True
End Try
End Function
|