Access is denied when trying to CreateFileAsync in InstalledLocation StorageFolder?

后端 未结 1 531
悲&欢浪女
悲&欢浪女 2021-01-02 09:25

I got Access is denied when trying to CreateFileAsync in InstalledLocation StorageFolder

StorageFolder storageFolder = Windows.ApplicationModel.Package.Curre         


        
相关标签:
1条回答
  • 2021-01-02 09:50

    The app's install directory is a read-only location. In addition, it would not be recommended that you write data files to the installed location. If you need to store data this is for the application's use only, you should use

    StorageFolder localFolder = ApplicationData.Current.LocalFolder;
    

    or

    Windows.Storage.StorageFolder temporaryFolder = ApplicationData.Current.TemporaryFolder;
    

    depending on the lifetime of the data.

    0 讨论(0)
提交回复
热议问题