This is what I ended up with:
Imports System.IO
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim fsw As New System.IO.FileSystemWatcher
fsw.Path = Application.StartupPath
fsw.Path = fsw.Path.Substring(0, fsw.Path.LastIndexOf("\")) + "\XferedData"
fsw.NotifyFilter = (NotifyFilters.LastWrite Or NotifyFilters.FileName)
fsw.Filter = "*.txt"
AddHandler fsw.Changed, New FileSystemEventHandler(AddressOf OnChanged)
AddHandler fsw.Created, New FileSystemEventHandler(AddressOf OnChanged)
fsw.EnableRaisingEvents = True
End Sub
Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
Dim wct As WatcherChangeTypes = e.ChangeType
Debug.WriteLine("File : {0} {1}", e.FullPath, wct.ToString())
Try
Using inputStream As FileStream = File.Open(e.FullPath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
Debug.WriteLine(Now & " READY ")
End Using
Catch ex As IOException
Debug.WriteLine(Now & " NOT READY YETT " & ex.Message)
End Try
End Sub
End Class