我正在尝试了解WindowsPhone Files/Folder。在按照msdn
编写方法时CreateFolderAsync
private async Task WriteToFile()
{
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
var dataFolder =await local.CreateFolderAsync("DataFolder", CreationCollisionOption.OpenIfExists);
//code goes here
}
给出错误
Type Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFolder> is not awaitable
当我删除await
关键字时它很好,但没有得到dataFolder.CreateFileAsync
方法。
并且我确信我没有错过任何参考。任何人都可以告诉为什么会发生这个错误?