将数据保存到应用缓存
该 ApplicationData.Current.LocalFolder API 允许我们可以访问应用程序缓存:
var file = await ApplicationData.Current.LocalFolder.CreateFileAsync("myFile.dat", CreationCollisionOption.ReplaceExisting);
该 FileIO 专注类包含了一套实用的方法来轻松地将数据添加到文件中:
await FileIO.WriteBytesAsync(file, array);
await FileIO.AppendTextAsync(file, "text");
await FileIO.WriteBufferAsync(file, iBuffer);