this.fileSystemWatcher.Path= "c:\\";
this.fileSystemWatcher.Filter= "bound.txt";
this.fileSystemWatcher.EnableRaisingEvents = true;
this.fileSystemWatcher.EnableRaisingEvents = true;
this.fileSystemWatcher.NotifyFilter = System.IO.NotifyFilters.LastWrite;
this.fileSystemWatcher.SynchronizingObject = this;
this.fileSystemWatcher.Changed += new System.IO.FileSystemEventHandler(this.fileSystemWatcher_Changed);
然后用ctrl+c拷贝文件,用ctrl+v粘贴替换,发现changed在同一秒产生两次
2006-10-17 11:30:20 c:\bound.txt changed
2006-10-17 11:30:20 c:\bound.txt changed
两次记录一摸一样,晕,是vs2005的bug?
this.fileSystemWatcher.Filter= "bound.txt";
this.fileSystemWatcher.EnableRaisingEvents = true;
this.fileSystemWatcher.EnableRaisingEvents = true;
this.fileSystemWatcher.NotifyFilter = System.IO.NotifyFilters.LastWrite;
this.fileSystemWatcher.SynchronizingObject = this;
this.fileSystemWatcher.Changed += new System.IO.FileSystemEventHandler(this.fileSystemWatcher_Changed);
然后用ctrl+c拷贝文件,用ctrl+v粘贴替换,发现changed在同一秒产生两次
2006-10-17 11:30:20 c:\bound.txt changed
2006-10-17 11:30:20 c:\bound.txt changed
两次记录一摸一样,晕,是vs2005的bug?
解决方案 »
- 如何将一个字符串转化为窗体类
- radioButton1.Checked==true 出错?
- 请问谁用过EnterPrise Library 4.0 中写日志功能
- 水晶报表(我现在要做一个水晶报表,是线图的。)
- 郁闷事情!!!!
- 在listbox中显示图像
- 找方法!service怎样定时执行一个程序 ?高手啊,不吝赐教吧
- 水晶报表的宽度为只读怎么办?导致我无法使我的报表加更多的字段.还有我使用水晶报表前总是询问我是否注册?请问怎么注册?
- PrintDocument的PrintPage事件中打印總頁數
- 最小化后,不在任务栏上,像QQ一样,怎么实现,大家一起聊!
- 两个类之间的传值和调用问题
- 为什么fileSystemWatcher的Changed 事件会出现2次
{
if (e.ChangeType == WatcherChangeTypes.Changed)
{
fileSystemWatcher.EnableRaisingEvents = false;
....
}
}
我得changed是这样写的