FileSystemWatcher.IncludeSubdirectories : FileSystemWatcher « System.IO « VB.Net by API






FileSystemWatcher.IncludeSubdirectories

  

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

   
    
  








Related examples in the same category

1.FileSystemWatcher.Changed
2.FileSystemWatcher.Created
3.FileSystemWatcher.Deleted
4.FileSystemWatcher.EnableRaisingEvents
5.FileSystemWatcher.Filter
6.FileSystemWatcher.NotifyFilter
7.FileSystemWatcher.Renamed