我建立一个Metro应用,我试图将其保存在StorageFile后获得的图像的开放的,这是我的代码:
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("samplefile.dat", CreationCollisionOption.ReplaceExisting);
IRandomAccessStream raStream = await file.OpenAsync(FileAccessMode.ReadWrite);
IOutputStream outStream = raStream.GetOutputStreamAt(0);
DataWriter dw = new DataWriter(outStream);
dw.WriteBytes(img); // I'm saving array of bytes
await outStream.FlushAsync();
我读这篇文章:
它说,我可以访问使用MS-应用程序数据存储的文件,所以我想这:
Uri uri = new Uri("ms-appdata:///samplefile.dat", UriKind.Absolute);
但它不工作