FTP文件观察家像SystemFileWatcher在.​​net中? [英] Ftp file watcher like SystemFileWatcher in .net?

查看:184
本文介绍了FTP文件观察家像SystemFileWatcher在.​​net中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的项目,我需要看多个FTP文件夹时间可持续,如果有新的文件来,我需要挑选的文件名,并做一些处理。

如果是正常的Windows /本地文件系统文件夹中,我可以通过使用 SystemFileWatcher .NET中实现这一点。

有什么喜欢的东西< STRONG> SystemFilewatcher 看FTP文件夹?

感谢
NRK


In my project I need to watch multiple FTP Folders continuosly, if any new file comes i need pick the filename and do some process.

If that is normal Windows/Local File System folder I can achieve this by using SystemFileWatcher of .net.

Is there any thing like SystemFilewatcher to watch FTP folders?

Thanks
nrk

推荐答案

没有,这并不存在,因为一个FTP文件夹不能给你任何变化的任何事件。所以,你必须有一个背景工人编写自己的小类。这问一个FTP服务器的目录列表,并定期对所获得的最后一个列表进行比较。然后你就可以触发一些事件,根据发生的变化。

No this doesn't exist, because a FTP folder can't send you any events about any change. So you have to write your own little class with a background worker. This one asks the ftp server for directory listing periodically and compares it against the last list obtained. Then you can fire some events depending on the happen changes.

所以,你会得到一个事件类在.net中,但引擎盖下这将是拉模型与大量的流量在电线上。

So you'll get an event class in .Net but under the hood it will be pull model with lot of traffic on the wire.

这篇关于FTP文件观察家像SystemFileWatcher在.​​net中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆