FtpWebRequest ListDirectory does not return hidden files(FtpWebRequest ListDirectory 不返回隐藏文件)
问题描述
使用 FtpWebRequest 列出目录的内容;但是,它没有显示隐藏文件.
Using FtpWebRequest to list the contents of a directory; however, it's not showing the hidden files.
如何让它显示隐藏文件?
How do I get it to show the hidden files?
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftp_root + path);
request.Method = WebRequestMethods.Ftp.ListDirectory;
FileZilla 正确列出了隐藏文件,因此我知道 FTP 服务器正在将这些数据返回给它.我只需要用 FtpWebRequest 复制它.或者为它使用不同的库.
FileZilla lists the hidden files correctly so I know the FTP server is returning that data to it. I just need to replicate that with FtpWebRequest. Or use a different library for it.
推荐答案
微软提供的 FtpWebRequest 并不执行列出 FTP、FTPS 或 SFTP 站点目录所需的所有操作.
The FtpWebRequest which is provided by Microsoft does not perform all the operations neccessary for listing FTP, FTPS or SFTP site's directories.
一个好的解决方案是使用一些其他的 dll,例如 WinScp、Ftp.dll,它们可以为您提供一些高效和额外的功能.
A good solution would be to use some other dll's like WinScp, Ftp.dll which can provide you with some efficient and extra functionalities.
这篇关于FtpWebRequest ListDirectory 不返回隐藏文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:FtpWebRequest ListDirectory 不返回隐藏文件
基础教程推荐
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
