0

サーバーから画像をダウンロードしてローカルファイルに保存しようとしています。私は試した

 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();



    }

しかし、それは代替手段として機能しません

4

1 に答える 1