问题
When converting an app to a Windows Store app, we add the files as mentioned here. But now - how do we access them? What's their path?
They're not in the special folder created for the package.
回答1:
You can create a folder structure in your project where you can include the files and then since you are already crossing the Centennial Bridge, you can start using the Windows.Storage.StorageFile WinRT API to interact with files.
For example, you can use: StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///folderUnderYourAppRoot/image.bmp")); to get the file which is under the "folderUnderYourAppRoot". This is the generic guidance: https://msdn.microsoft.com/en-us/windows/uwp/files/quickstart-reading-and-writing-files, so you can review it further...
来源:https://stackoverflow.com/questions/39625644/get-file-paths-for-files-in-centennial-app