C# 如何在windows phone 8.1中使用后台下载程序下载图像

C# 如何在windows phone 8.1中使用后台下载程序下载图像,c#,windows-phone-8,windows-phone-8.1,windows-phone,C#,Windows Phone 8,Windows Phone 8.1,Windows Phone,我想从windows phone 8.1中的URL下载图像,我使用了BackgroundDownloader,但它不起作用,有人能帮我吗 var source = new Uri(source_image, UriKind.Absolute); string LocalName = "10oswall"; var destinationFile = await KnownFolders.PicturesLibrary.CreateFileAsync( LocalName,

我想从windows phone 8.1中的URL下载图像,我使用了
BackgroundDownloader
,但它不起作用,有人能帮我吗

var source = new Uri(source_image, UriKind.Absolute);
string LocalName = "10oswall";
var destinationFile =
    await KnownFolders.PicturesLibrary.CreateFileAsync(
        LocalName, CreationCollisionOption.ReplaceExisting);
var downloader = new BackgroundDownloader();
DownloadOperation download = downloader.CreateDownload(source, destinationFile);

download.Priority = BackgroundTransferPriority.High;
await download.StartAsync();

你说“不工作”是什么意思?它运行了,但我在手机里没有看到我的图像。你调试过吗?下载是否引发任何异常?另外请注意,文档明确指出
BackgroundDownloader
适用于大文件(如视频)而不是小文件(如图像)-您可能只需要使用
HttpClient
即可。