在 Xamarin Forms 中,我们如何检查 Environment.SpecialFolder.DesktopDirectory 是否包含文件?我正在使用以下内容从 azure 存储下载图像并将它们显示在页面上,它工作正常,但我只想在不存在文件的情况下执行此操作。_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 关注
- 149 浏览
添加回答
举报
0/150
提交
取消