我正在尝试从服务器下载图像并将其保存在本地文件中。我试过了
private async void save()
{
Uri source = new Uri("http://www.google.ca/intl/en_com/images/srpr/logo1w.png");
StorageFile destinationFile;
try
{
destinationFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(
"downloadimage.jpg", CreationCollisionOption.GenerateUniqueName);
}
catch (FileNotFoundException ex)
{
System.Diagnostics.Debug.WriteLine("bingooooo"+ex.ToString());
return;
}
BackgroundDownloader downloader = new BackgroundDownloader();
DownloadOperation download = downloader.CreateDownload(source, destinationFile);
await download.StartAsync();
ResponseInformation response = download.GetResponseInformation();
}
但它没有任何选择