C#类来分析WebRequestMethods.Ftp.ListDirectoryDetails FTP响应 [英] C# class to parse WebRequestMethods.Ftp.ListDirectoryDetails FTP response
问题描述
我要创建一个服务来监控新的更新FTP位置,并不需要使用解析从的FtpWebRequest 响应返回的响应能力在 WebRequestMethods.Ftp.ListDirectoryDetails 方法。 。这将是相当容易的,如果所有的响应遵循同样的格式,但是不同的FTP服务器软件,提供不同的响应格式
I'm creating a service to monitor FTP locations for new updates and require the ability to parse the response returned from a FtpWebRequest response using the WebRequestMethods.Ftp.ListDirectoryDetails method. It would be fairly easy if all responses followed the same format, but different FTP server software provide different response formats.
例如有人可能会返回:
08-10-11 12:02PM <DIR> Version2
06-25-09 02:41PM 144700153 image34.gif
06-25-09 02:51PM 144700153 updates.txt
11-04-10 02:45PM 144700214 digger.tif
和其他服务器可能返回:
And another server might return:
d--x--x--x 2 ftp ftp 4096 Mar 07 2002 bin
-rw-r--r-- 1 ftp ftp 659450 Jun 15 05:07 TEST.TXT
-rw-r--r-- 1 ftp ftp 101786380 Sep 08 2008 TEST03-05.TXT
drwxrwxr-x 2 ftp ftp 4096 May 06 12:24 dropoff
和其他方面的差异也已被发现所以有可能是一些我还没有遇到过细微的差别。
And other differences have been observed also so there's likely to be a number of subtle differences I haven't encountered yet.
有谁知道一个全面管理(不需要访问外部的dll在Windows上)C#类无缝地处理这些情况?
Does anyone know of a fully managed (doesn't require access to external dll on Windows) C# class that handles these situations seamlessly?
我只需要按照以下细节列出目录的内容:文件/目录名,最后更新或创建的时间戳的文件/目录名
I only need to list the contents of a directory with the following details: File/directory name, last updated or created timestamp, file/directory name.
谢谢提前任何建议,
加文
Thanks in advance for any suggestions, Gavin
推荐答案
我碰到一个解决办法是的 EdtFTPnet
One solution I came across is EdtFTPnet
EdtFTPnet似乎是相当一个功能丰富的解决方案处理很多不同的FTP选项,因此是理想的。
EdtFTPnet seems to be quite a feature packed solution that handles lots of different FTP options so is ideal.
这是免费的开源的解决方案,我已经为如何的 http://www.ftp2rss.com (一个小工具,我需要我自己想通,但可能是对他人也有用)。
It's the free open source solution that I've how employed for http://www.ftp2rss.com (a little tool I needed myself but figured might be useful to others also).
这篇关于C#类来分析WebRequestMethods.Ftp.ListDirectoryDetails FTP响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!