Watch a Directory and Process Copied Files -Check for Copy Completion and Open Handles
问题 I need to watch a directory for image files(jpeg,png,tif,gif,bmp) and process new files placed there.Im trying to implement this using FileSystemWatcher private void watch() { FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = path; watcher.Filter = "*.*"; watcher.Changed += new FileSystemEventHandler(OnChanged); watcher.EnableRaisingEvents = true; } But how can i make sure that the file is copied in full and there is no handle locking the file before trying to open it? 回答1: