私がこれをやろうとすると:
folderPicker = new FolderPicker();
folderPicker.SuggestedStartLocation = PickerLocationId.Desktop;
folderPicker.FileTypeFilter.Add(".txt");
StorageFolder folder = await folderPicker.PickSingleFolderAsync();
エラーが表示されます:
エラー 2 'await' 演算子は、非同期メソッド内でのみ使用できます。このメソッドを 'async' 修飾子でマークし、その戻り値の型を 'Task' に変更することを検討してください。C:\Users\Lukasz\Documents\Visual Studio 2012\Projects\RobimyProjekt\RobimyProjekt\ImageBrowser.xaml.cs.
「await」を削除すると、別のエラーが表示されます:
エラー 2 タイプ 'Windows.Foundation.IAsyncOperation' を 'Windows.Storage.StorageFolder' に暗黙的に変換できません C:\Users\Lukasz\Documents\Visual Studio 2012\Projects\RobimyProjekt\RobimyProjekt\ImageBrowser.xaml.cs 61 36 RobimyProjekt.
どうしたの?そのコードは、Visual Studio 2012 を使用して msdna と i からのものです。