FileSystemWatcher的支持FTP [英] FileSystemWatcher for FTP

查看:266
本文介绍了FileSystemWatcher的支持FTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何能实现一个 FileSystemWatcher的为FTP位置(在C#)。我们的想法是一旦有事情在FTP位置我想将它复制到我的本地机器被添加。任何的想法会有所帮助。

How can I implement a FileSystemWatcher for an FTP location (in C#). The idea is whenever anything gets added in the FTP location I wish to copy it to my local machine. Any ideas will be helpful.

这是一个跟进我刚才的问题的使用.NET 选择FTP下载。

This is a follow up of my previous question Selective FTP download using .NET.

推荐答案

您就要有实现轮询的解决方案,让您继续要求定期目录的内容。这从以前的呼叫相比较而言,缓存列表,并确定发生了什么事的方式。

You're going to have to implement a polling solution, where you keep asking for the directory content periodically. Compare this to a cached list from the previous call and determine what happened that way.

有什么在FTP协议,这将有助于你这个很遗憾。

There's nothing in the FTP protocol that will help you with this unfortunately.

这篇关于FileSystemWatcher的支持FTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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