问题描述
我正在构建一个现代ui应用程序,并希望使用批处理文件编写并定期更新可通过winjs中的 ms-appdata://
协议访问的数据。应用程式。我有要复制文件夹的批处理文件,但是找不到appdata的文件路径。
I am building a modern ui app and want to, with a batch file, write and periodically update data accessible though the ms-appdata://
protocol in my winjs app. I have the batch file to copy folders, but I cannot find the file path of the appdata.
App1的默认文件路径是什么
的appdata,以及如何强制我的应用创建文件夹?
What is the default filepath for App1
's appdata and how can I force my app to create the folder?
推荐答案
ms-appdata:/ // [本地|漫游| temp] /映射到Windows.Storage.ApplicationData.Current.localFolder,roamingFolder和临时文件夹返回的StorageFolder。请参阅为例。因此,您可以从该API获取合适的StorageFolder,然后从那里创建文件夹和文件,然后使用ms-appdata URI引用它们。
ms-appdata:///[local | roaming | temp]/ maps to the StorageFolder returned from Windows.Storage.ApplicationData.Current.localFolder, roamingFolder, and temporaryFolder. See https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.localfolder.aspx as an example. So you can obtain the appropriate StorageFolder from that API create folders and files from there, and then use ms-appdata URIs to refer to them.
请注意,您始终想使用Windows.Storage.ApplicationData API来访问这些文件夹,而不是使用绝对路径名。 StorageFolder和StorageFile是路径名的WinRT抽象,并完全替换它们。
Note that you always want to use the Windows.Storage.ApplicationData API to access those folders rather than using absolute pathnames. StorageFolder and StorageFile are the WinRT abstractions for pathnames and wholly replace them.
这篇关于ms-appdata在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!