在 Xamarin Forms 中,我們?nèi)绾螜z查 Environment.SpecialFolder.DesktopDirectory 是否包含文件?我正在使用以下內(nèi)容從 azure 存儲下載圖像并將它們顯示在頁面上,它工作正常,但我只想在不存在文件的情況下執(zhí)行此操作。_activityIndicator.IsRunning = true; var imgPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), ""); var blobList = await BlobStorageService.GetBlobs<CloudBlockBlob>("images"); foreach (CloudBlockBlob b in blobList) { Image _image = new Image(); imgPath = imgPath + b.Name; await b.DownloadToFileAsync(imgPath, FileMode.Create); StackLayout s = new StackLayout(); _title.Text = b.Name; _image.Source = imgPath; s.Children.Add(_title); s.Children.Add(_image); iStack.Children.Add(s); }
- 1 回答
- 0 關(guān)注
- 166 瀏覽
添加回答
舉報
0/150
提交
取消