FtpWebRequest ListDirectory不返回隐藏的文件 [英] FtpWebRequest ListDirectory does not return hidden files

查看:96
本文介绍了FtpWebRequest ListDirectory不返回隐藏的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



如何显示隐藏文件?

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

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

解决方案

FtpWebRequest 由微软提供的并不执行所有需要列出FTP,FTPS或SFTP站点目录的操作。



一个好的解决方案是使用其他一些DLL,如WinScp,Ftp。 dll,它可以为您提供一些有效的和额外的功能。


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 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.

解决方案

The FtpWebRequest which is provided by Microsoft does not perform all the operations neccessary for listing FTP, FTPS or SFTP site's directories.

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不返回隐藏的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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