[英]How to store an image from http server to local folder? c# (win8, app)
[英]how to save image downloaded from url(server) to local folder in windows store app
我正在嘗試從服務器下載圖像並將其保存在本地文件中。 我試過了
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();
}
但它沒有其他選擇
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.