试试
Dim fileName As String = "c:\abc.txt"
Dim inUse As Boolean = True
Dim fs As system.io.FileStream = Nothing
Try
fs = New system.io.FileStream(fileName, system.io.FileMode.Open, system.io.FileAccess.Read, system.io.FileShare.None)
inUse = False
Catch ex As Exception
Finally
If (fs IsNot Nothing) Then
fs.Close()
End If
End Try
msgbox(inUse)