从HTTP下载目录 [英] Download Directory from HTTP

查看:70
本文介绍了从HTTP下载目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



如何下载htaccess启用目录列表的目录?



谢谢

Hello,

how i can download a directory where htaccess enable directory listing?

Thanks

推荐答案

您可以分两步完成。在第一步中,您将获得目录列表。然后解析文本,提取文件名并单独下载每个文件。您只需要下载一个课程:

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx [ ^ ]

甚至更简单,你可以使用 http:/ /msdn.microsoft.com/en-us/library/ms144194%28v=vs.110%29.aspx [ ^ ]。



假设您期望URLhttp://www.someDomain.tld/some/directory/上的目录列表。使用此URL下载将为您提供列表,并找出文件名并逐个下载为http://www.someDomain.tld/some/directory/file1,http://www.someDomain .tld / some / directory / file2等等。



请查看我过去的答案:

从网页中获取特定数据 [ ^ ],

如何从其他网站获取数据 [ ^ ]。



-SA
You can do it in two steps. In first step, you get the directory listing. Then you parse the text, to extract file names and download each file separately. You need only one class for downloading:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx[^]
or even, simpler, you can use the method http://msdn.microsoft.com/en-us/library/ms144194%28v=vs.110%29.aspx[^].

Suppose you expect a directory listing at the URL "http://www.someDomain.tld/some/directory/". Downloading with this URL will give you the listing, and the you figure out file name and download them one by one as "http://www.someDomain.tld/some/directory/file1", "http://www.someDomain.tld/some/directory/file2", etc.

Please see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA


这篇关于从HTTP下载目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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