gpt4 book ai didi

c# - FtpWebRequest ListDirectory 不返回隐藏文件

转载 作者:行者123 更新时间:2023-12-02 07:44:56 26 4
gpt4 key购买 nike

使用FtpWebRequest列出目录的内容;但是,它没有显示隐藏文件。

如何让它显示隐藏文件?

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftp_root + path);
request.Method = WebRequestMethods.Ftp.ListDirectory;

FileZilla 正确列出了隐藏文件,因此我知道 FTP 服务器正在向其返回该数据。我只需要使用 FtpWebRequest 复制它。或者使用不同的库。

最佳答案

Microsoft 提供的FtpWebRequest 不会执行列出 FTP、FTPS 或 SFTP 站点目录所需的所有操作。

一个好的解决方案是使用其他一些 dll,例如 WinScp、Ftp.dll,它们可以为您提供一些高效且额外的功能。

关于c# - FtpWebRequest ListDirectory 不返回隐藏文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42429441/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com