Tuesday, November 15, 2005

FileSystemWatcher example

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With FileSystemWatcher1
.Path = Application.StartupPath
.EnableRaisingEvents = True
.IncludeSubdirectories = False
.Filter = "*.csv"
End With
End Sub

Private Sub FileSystemWatcher1_Changed(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed
MsgBox("change has occured")
End Sub

No comments:

Post a Comment