首页 > Windows开发 > 详细

win8 中实现断点续传

时间:2014-04-02 08:42:30      阅读:442      评论:0      收藏:0      [点我收藏+]

1) Resume method does resume on cases where resume is possible. Meaning if the server accepts range-requests, the download would resume, otherwise restart.

2) When you are creating the storage file store your data, you have to use GenerateUnique name enum value to avoid overriding the existing file.

StorageFile destinationFile = await KnownFolders.PicturesLibrary.CreateFileAsync(
                    destination,CreationCollisionOption.GenerateUniqueName);BackgroundDownloader downloader =newBackgroundDownloader();DownloadOperation download = downloader.CreateDownload(source, destinationFile)

 

3) If the HttpClient is giving you a hard time with the download, you can always embellish it with a download progress. This would sustain the fluid UI and avoid non responsive application. Here is an example that is to be used with servers which allow chunked encoding: Download / Send Request Async with Progress

Posted in: Windows 8WinRT. Tagged: ,. 11 Comments

Hope it helps, and you might want to try to post it to a local group rather than the english one. You might get more responses.

win8 中实现断点续传,布布扣,bubuko.com

win8 中实现断点续传

原文:http://www.cnblogs.com/CharlesGrant/p/3639214.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!