How do you access a Metro app's local storage in a desktop application in Windows 8?

牧云@^-^@ 提交于 2019-12-12 10:56:42

问题


Is there an API available for this in .Net? What about in the Windows API? If not, has anyone come up with some hackish-way to do this yet?


回答1:


Finding the local storage folder of a Windows 8 Style application

http://blog.falafel.com/Blogs/paul-tidwell/2012/08/27/finding-the-local-storage-folder-of-a-windows-8-style-application

The path to Windows 8 Style apps is as follows:

C:\Users\{username}\AppData\Local\Packages\Microsoft.BingSports_8wekyb3d8bbwe

There is a new Windows API which uses an internal and undisclosed algorithm to create a publisher hash, which when appended to the package name becomes the family name. Family name looks like {packagename}_{publisherhash}

If you wanted another desktop application or need to share this between some set of applications you can call the API via PowerShell cmdlet like so:

(Get-AppxPackage -AllUsers -Name  $name).PackageFamilyName

Write that to the registry and voila! Your application can use Environment.UserName and the path pattern above to easily find your appx local storage.



来源:https://stackoverflow.com/questions/13144479/how-do-you-access-a-metro-apps-local-storage-in-a-desktop-application-in-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!