Imports System.IO
Module Module1
WithEvents Watcher As New FileSystemWatcher("C:\")
Sub Main()
Watcher.Filter = "*.*"
Watcher.IncludeSubdirectories = True
Watcher.EnableRaisingEvents = True
Console.ReadLine()
End Sub
Sub OnChanged(ByVal From As Object, ByVal e As FileSystemEventArgs) Handles Watcher.Changed
Dim DateAndTime As DateTime = DateTime.Now
Console.WriteLine(e.FullPath & " " _
& e.ChangeType() & " " & DateAndTime)
End Sub
End Module
|