I have a filesystemwatcher written from examples found here that is working fine, along the lines:
Public monitor As FileSystemWatcher
monitor = New System.IO.FileSystemWatcher()
monitor.Path = c:\temp\
monitor.NotifyFilter = IO.NotifyFilters.DirectoryName
monitor.NotifyFilter = monitor.NotifyFilter Or IO.NotifyFilters.FileName
monitor.NotifyFilter = monitor.NotifyFilter Or IO.NotifyFilters.Attributes
'Add handlers
AddHandler monitor.Changed, AddressOf fileevent
AddHandler monitor.Created, AddressOf fileevent
AddHandler monitor.Deleted, AddressOf fileevent
'Start watching
monitor.EnableRaisingEvents = True
What I'm struggling with is expanding on this to monitor multiple folders, but without knowing except at run time how many folders there will be to monitor.
This question seems to cover it in C# Multiple Configurable FileSystemWatcher methods
But my lack of experience is so far preventing me from managing to translate this to VB.NET