【问题标题】:Differences between ListDirectory and ListDirectoryDetails FTP methods in C#C# 中 ListDirectory 和 ListDirectoryDe​​tails FTP 方法的区别
【发布时间】:2016-04-24 08:41:44
【问题描述】:

我想列出 FT Pserver 中的文件。

我使用ListDirectoryListDirectoryDetails FTP 方法列出文件。

那得到文件列表,但是ListDirectory 方法中的文件数少于ListDirectoryDetails 方法,但我不知道为什么?

有可能吗???

【问题讨论】:

    标签: c# .net ftp ftpwebrequest


    【解决方案1】:

    ListDirectory 方法使用 FTP NLST 命令。

    ListDirectoryDetails 方法使用 FTP LIST 命令。

    这取决于 FTP 服务器,它在对每个命令的响应中返回什么。 .NET 框架无论如何都无法控制它。

    RFC 959 只这么说:

    • LIST:
      RFC 没有说明列表应该包含什么,只是:

      由于文件上的信息可能因系统而异 对系统来说,这些信息可能很难自动使用 在程序中,但可能对人类用户非常有用。

    • NLST:

      服务器 将返回文件名流,没有其他 信息。

    我们不知道您的 FTP 服务器是什么,因此我们无法为您提供更多详细信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-20
      • 1970-01-01
      相关资源
      最近更新 更多