Introduction
With this app, you can monitor seven folders without any CPU loss .. and add up to seven folders to mirror in real time!
This application can also manage directories and subdirectories and the operations Add, Delete, Edit etc.
Background
The solution uses the WatchFolder class from the .NET Framework.
watchfolder.Path = source12.Text
watchfolder.Filter = "*.*" watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.FileName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.Attributes
watchfolder.IncludeSubdirectories = True
AddHandler watchfolder.Renamed, AddressOf logchanger
AddHandler watchfolder.Created, AddressOf logchange
AddHandler watchfolder.Changed, AddressOf logchange
AddHandler watchfolder.Deleted, AddressOf logchange
watchfolder.EnableRaisingEvents = True
Using the Code
Add these Imports statements:
Imports Microsoft.Win32
Imports System.IO
Here is how we use the code:
AddHandler watchfolder.Renamed, AddressOf logchanger
AddHandler watchfolder.Created, AddressOf logchange
AddHandler watchfolder.Changed, AddressOf logchange
AddHandler watchfolder.Deleted, AddressOf logchange
Points of Interest
The app can save all input from the user the first time inside the Registry.
History