使用C#使下载断点续传

问题描述:

我用这个方法( Web客户端班)从互联网上下载一个文件:

I am using this method (WebClient Class) for downloading a file from the Internet :

private Task DownloadUpdate(string url, string fileName)
{
       var wc = new WebClient();
       return wc.DownloadFileTaskAsync(new Uri(url), @"c:\download" + fileName);
}

如何让下载的可恢复的使用上面的code?

How can I make the download resumable using the above code?

从HttpWebRequest或WebRequest的 - 简历下载ASP.NET :

恢复文件是通过指定该文件的字节范围做你
  想使用Range HTTP标头进行下载。这是可以做到
  与 HttpWebRequest.AddRange 功能。

Resuming files is done by specifying the byte range of the file you would like to download using the Range HTTP header. This can be done in .NET with the HttpWebRequest.AddRange function.

例如:

request.AddRange(1000);