System.IO.FileSystemWatcher
watchfolder = New System.IO.FileSystemWatcher
watchfolder.Path = "C:\Test\" watchfolder.IncludeSubdirectories = True watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.FileName watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.Attributes watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.Size AddHandler watchfolder.Changed, AddressOf logchange AddHandler watchfolder.Created, AddressOf logchange AddHandler watchfolder.Deleted, AddressOf logchange AddHandler watchfolder.Renamed, AddressOf logrename watchfolder.EnableRaisingEvents = True Private Sub logchange(ByVal source As Object, ByVal e As _ System.IO.FileSystemEventArgs) If e.ChangeType = IO.WatcherChangeTypes.Changed Then Dim FileSize As Long = New System.IO.FileInfo(e.FullPath).Length End If If e.ChangeType = IO.WatcherChangeTypes.Created Then Dim FileSize As Long = New System.IO.FileInfo(e.FullPath).Length End If If e.ChangeType = IO.WatcherChangeTypes.Deleted Then Dim FileSize As Long = New System.IO.FileInfo(e.FullPath).Length End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)