本文介绍了Filewatcher的OnCreate事件无法捕获Syctoy2.1上载(创建)的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在编写一个监听目录的程序 读取xml文件并在创建文件时将节点值添加到数据库。当我在该目录中手动添加或创建文件时,该程序可以正常工作。但是当synctoy 2.1添加了新文件时,它不会产生
的工作。你知道吗?解决该问题的方法

I'm writing a program which listen a directory and  reads xml files and add nodes value to database when a file is created. the program works when I add or create a file manually in that directory. but when new files added by the synctoy 2.1 it deoesn't work. Do you know a  way to solve that problem

推荐答案

1)创建没有其他事件的事件(文件创建并写为一个)。

1) Created event with no further events (file created and written as one).

2)创建事件后跟随任意数量的其他Changed事件,因为文件是零敲碎写的。

2) Created event followed by any number of additional Changed events as the file is written piecemeal.

3)创建临时文件的事件,更改temp的事件file,重命名事件以将临时文件重命名为最终文件。

3) Created event for a temp file, Changed events for the temp file, Renamed event to rename the temp file to the final file.

打开您正在侦听的过滤器和文件。然后进行测试以查看正在引发的事件。

Open up the filters and files you're listening for. Then do your test to see which events are being raised.


这篇关于Filewatcher的OnCreate事件无法捕获Syctoy2.1上载(创建)的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 18:58