在C#中多行下载? [英] Multipart Downloading in C#?

查看:164
本文介绍了在C#中多行下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我对这个问题的无知。



我想在C#中编写一个应用程序,可以以相同的方式从服务器下载文件 DownThemAll 。 DownThemA似乎打开四个连接到HTTP服务器下载相同的文件。我只是想知道是否有任何现有的图书馆可能会这样做。



以下是他们网站上有关此功能的引用:


DownThemAll具有称为多部分下载的智能下载技术。它将文件分割成多个部分,同时下载。


我也希望能够暂停/恢复下载。这是我想要的基本功能,我不一定需要一个完整的下载管理器库,但如果有一个可以做这些事情,我也很想知道他们。这些文件位于使用lighttpd托管的受密码保护的目录中,所以我也需要一些验证方式。



如果没有任何预先存在的库可以使用,那么我应该研究哪个.net课程可能可以做到这一点?



谢谢!



编辑:将标题更改为更合适,并从DownThemAll网站中添加一个引用内容的引用。解释它是什么。



2nd编辑:我认为,svens到目前为止最适合的答案,虽然作为一个评论:/这是我的错,因为我错了标题,因为我不知道我在说什么。他发布了一个通过HTTP下载暂停/恢复的文章 。它也谈到 Range 头,这是我认为我应该使用的:


Range头可以在一个请求中询问多个范围,这个功能称为multipart range。不要将此与分段下载混淆,几乎所有下载工具都可用来提高下载速度。这些工具声称通过打开两个或多个同时连接来提高下载速度,每个连接请求文件的不同范围。


所以我想要使​​用该范围同时下载文件的某些部分。那么再一次,这可能没有任何优势,只需一次下载文件。我只是这样做,并允许暂停/恢复。



谢谢你们!



PS svens,go提前发表评论作为答案,以便我可以接受它,如果你想要。

解决方案

我在这个, http://www.devx.com/dotnet/Article/22533/0/page/2 似乎说这一切。


Please excuse my ignorance on the subject.

I would like to write an application in C# that can download files off a server the same way DownThemAll does. DownThemAll seems to open four connections to the HTTP server to download the same file. I was just wondering if there are any existing libraries that might do this.

Here is a quote from their site about this feature:

DownThemAll features a smart download technique called ‘multipart download’. It splits files into multiple sections, which are downloaded simultaneously.

I would also like to be able to pause/resume the downloads. That's the basic functionality I would like, I don't necessarily need a full fledged download manager library, but if there is one that can do these things then I'd love to know about them too. The files are in a password protected directory hosted with lighttpd, so I would also need some way to authenticate myself.

If there aren't any pre-existing libraries that I can use, then what .net classes should I look into that might be able to do this?

Thanks!

EDIT: Reworded the title to be more appropriate and added a quote from the DownThemAll site explaining what it is.

2nd EDIT: I believe svens posted the most appropriate answer so far, although as a comment :/ It's my fault since I misworded the title as I did not know what I was talking about. He posted an article which goes over HTTP download pausing/resuming. It also talks about the Range header which is what I think I'm supposed to use:

The Range header is capable of asking for more than one range in one single request, a feature called "multipart ranges." Don't confuse this with segmented downloading, which almost all downloading tools use to increase the speed of the download. These tools claim to improve download speed by opening two or more simultaneous connections, each of which requests a different range of the file.

So I take it I want to use the range to download certain parts of the file concurrently. Then again this probably doesn't have any advantage over just downloading the file in one go. I'll just do that and allow for pausing/resuming.

Thanks guys!

P.S svens, go ahead and post the comment as an answer so that I can accept it if you want.

解决方案

I'm with svens on this, http://www.devx.com/dotnet/Article/22533/0/page/2 seems to say it all.

这篇关于在C#中多行下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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