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

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

问题描述

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

Please excuse my ignorance on the subject.

我想C#编写的应用程序可以下载文件从一台服务器 DownThemAll 不会以同样的方式。 DownThemAll似乎打开四个连接到HTTP服务器来下载同一个文件。我只是想知道是否有可能做到这一点的任何现有的库。

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功能称为多部分下载智能下载技术。它分割文件到多个部分,同时下载。

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

我也希望能够暂停/恢复下载。这是基本的功能,我想,我并不需要一个完全成熟的下载管理器库,但如果有一个可以做这些事情,然后我很想了解他们。该文件在托管与lighttpd的一个受密码保护的,所以我也需要一些方法来自己进行身份验证。

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.

如果没有任何$ P $,我可以使用对现有的库的话,我应该考虑什么.NET类可能能够做到这一点?

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?

谢谢!

修改:重述标题更合适,并从DownThemAll网站添加报价说明它是什么

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

第二次修改:我相信svens贴在最合适的答案为止,虽然为注释:/这是我的错,因为我misworded的称号,因为我不知道我在说什么。他发布了一个文章肚里通过HTTP下载暂停/恢复。它也谈到了范围头是什么,我想我应该是:

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.

谢谢你们!

PS svens,继续和张贴评论作为一个答案,这样我可以接受它,如果你想要的。

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

推荐答案

我对这个svens,的 http://www.devx.com/dotnet/Article/22533/0/page/2 似乎说明了一切。

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天全站免登陆