我有以下一段代码
// Point to c:\users\yancheng\documents\visual studio 2012\Projects\App5\App5\bin\x86\Debug\AppX
StorageFolder storageFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
StorageFile file = await storageFolder.CreateFileAsync("1000.txt");
if (file != null)
{
using (IRandomAccessStream writeStream = await file.OpenAsync(FileAccessMode.ReadWrite))
{
using (DataWriter dataWriter = new DataWriter(writeStream))
{
dataWriter.WriteInt32(1000);
}
}
}
我已通过 启用所有权限Package.appxmanifest
。但是,我不确定为什么我仍然UnauthorizedAccessException
在storageFolder.CreateFileAsync
.
还有什么我错过的吗?