画像をアップロードして Assets フォルダーに保存する必要がある Windows ストア アプリケーションを開発しています。私はC#が初めてです。これが私のコードです。
var picker = new FileOpenPicker();
picker.SuggestedStartLocation = PickerLocationId.Desktop;
picker.ViewMode = PickerViewMode.Thumbnail;
picker.FileTypeFilter.Add(".jpg");
picker.FileTypeFilter.Add(".jpeg");
StorageFile file = await picker.PickSingleFileAsync();
if (file == null) return;
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
BitmapImage image = new BitmapImage();
image.SetSource(stream);
imageTargetControl.Source = image;
StorageFolder storageFolder = KnownFolders.DocumentsLibrary;
StorageFile copyFile = await file.CopyAsync(storageFolder);
親切に私を助けてください。ありがとう