我在 InstalledLocation StorageFolder 中尝试 CreateFileAsync 时访问被拒绝
StorageFolder storageFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
StorageFile file = await storageFolder.CreateFileAsync("fileNmae", Windows.Storage.CreationCollisionOption.ReplaceExisting);
我也试过
var storageFolder = await StorageFolder.GetFolderFromPathAsync("ms-appx:///");
并得到“值不在预期范围内”
我可以绕过然后CreateFileAsync
进入InstalledLocation StorageFolder吗?Windows.Storage.ApplicationData.Current.LocalFolder
CopyAsync
StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile file = await storageFolder.CreateFileAsync("fileName", Windows.Storage.CreationCollisionOption.ReplaceExisting);
StorageFolder installedLocationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
var result = await file.CopyAsync(installedLocationFolder, "fileName", Windows.Storage.NameCollisionOption.ReplaceExisting);
但CreateFileAsync
在 InstalledLocation StorageFolder 中拒绝访问?是因为安全原因还是我在这里编码错误?