public void InitFileSystemWatche object path FileSystemWatcher FSWatch

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
public void InitFileSystemWatcher(object path)
{
FileSystemWatcher FSWatcher = new FileSystemWatcher();
FSWatcher.Path = (string)path;
FSWatcher.Filter = "*";
FSWatcher.Changed += new FileSystemEventHandler(OnChanged);
FSWatcher.Created += new FileSystemEventHandler(OnChanged);
FSWatcher.Deleted += new FileSystemEventHandler(OnChanged);
FSWatcher.Renamed += new RenamedEventHandler(OnChanged);
FSWatcher.EnableRaisingEvents = true;
}