编写软件时,常需实现程序间协作或对文件变动进行监听并响应。以下以监控记事本文件修改为例,说明如何实时捕捉外部文件变化并触发相应操作。 1、 启动VS,选择VisualC模板新建一个WPF应用项目。将项目命名为FileSystemWatcherTest,设置保存路径后点击确定 ...
The FileSystemWatcher class in the System.IO namespace can be used to monitor changes to the file system. It watches a file or a directory in your system for changes and triggers events when changes ...
I have a directory on a remote machine into which client computers will place files, I need to write code to respond to the creation of those files, and the best way I could come up with in C# was ...
When you need to know when a file or folder appears, disappears or is renamed -- in fact, if almost anything at all happens in the file system -- you can have Windows notify your application so that ...
I'm using .NET's FileSystemWatcher to monitor a directory for any new, changed, or deleted documents. I've set the NotifyFilter to NotifyFilters.LastWrite. <BR><BR>For some reason, whenever I use Word ...