如何访问一个地铁应用程序的本地存储在一个桌面应用程序在Windows 8? [英] How do you access a Metro app's local storage in a desktop application in Windows 8?

查看:163
本文介绍了如何访问一个地铁应用程序的本地存储在一个桌面应用程序在Windows 8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个API可用于该在.net中?那么在Windows API?如果没有,有没有人想出一些的hackish-办法做到这一点了吗?

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?

推荐答案

查找在Windows 8风格的应用程序的本地存储文件夹

Finding the local storage folder of a Windows 8 Style application

<一个href="http://blog.falafel.com/Blogs/paul-tidwell/2012/08/27/finding-the-local-storage-folder-of-a-windows-8-style-application" rel="nofollow">http://blog.falafel.com/Blogs/paul-tidwell/2012/08/27/finding-the-local-storage-folder-of-a-windows-8-style-application

该路径的Windows 8风格的应用程序如下:

The path to Windows 8 Style apps is as follows:

C:\用户\ {用户名} \应用程序数据\本地\包\ Microsoft.BingSports_8wekyb3d8bbwe

有一个新的Windows API,它使用内部和未公开的算法来创建一个出版商哈希,当其追加到包名变成了姓。姓看起来像 {包名称} _ {publisherhash}

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}

如果你想其他桌面应用程序还是需要一些一套应用程序之间共享这个你可以通过调用PowerShell命令的API,像这样:

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

编写到注册表,瞧!您的应用程序可以使用Environment.UserName和路径上面的图案很容易地找到你的APPX本地存储。

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.

这篇关于如何访问一个地铁应用程序的本地存储在一个桌面应用程序在Windows 8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆