在 uwp 中读/写注册密钥文件 [英] read/write registery key file in uwp

查看:39
本文介绍了在 uwp 中读/写注册密钥文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 uwp 应用程序中创建或读取注册文件.然后我应该能够 将菜单项添加到窗口上下文菜单.我知道这是不可能的,因为 uwp 应用程序在沙箱中运行.我在 uwp 中找不到有关该主题的任何来源.

I want to create or read a registery file within a uwp app. Then I should be able to add menu item to windows context menu. I'm aware that this is not possible, because uwp apps run in a sandbox. I'cant find any source about that topic for uwp.

有人可以批准我的计划可用于 uwp 应用吗?

Can someone approve that my plan is realisable for a uwp app?

推荐答案

我想在 uwp 应用程序中创建或读取注册表文件.

I want to create or read a registry file within a uwp app.

简短的回答是访问系统注册表对于 UWP 应用是不可行的.

Short answer is accessing to system registry is infeasible for a UWP app.

在 UWP 应用模型下,每个 UWP 应用通过在单独的 AppContainer 中运行来隔离.运行时还隔离了注册表访问.

Under the UWP app model, each UWP app is isolated by running inside separate AppContainer. The runtime also isolates registry access.

您可以在 Build 2015 Keynote 中找到有关 UPW 应用程序模型的更多信息,可以在视频中找到幻灯片.https://channel9.msdn.com/Events/Build/2015/2-617

You can find more information on UPW app model form the Build 2015 Keynote, slides can be found along with the video. https://channel9.msdn.com/Events/Build/2015/2-617

https://blogs.windows.com/buildingapps/2015/04/30/a-deeper-dive-into-the-universal-windows-platform/

但是,您可以为旁加载的 Windows 应用商店应用试用代理 Windows 运行时组件.本质上,它允许您的 UWP 应用调用托管在不同进程中的 Win32 API,该进程在应用容器之外运行.

以下是 VS2015 的代理 WinRT 组件模板 https://visualstudiogallery.msdn.microsoft.com/d2e9cac0-66a8-464a-a902-55ae765c8e6e()5165c8e6e()5165c85c85c6e()58c85c85c85c6e()562705c85c65c65c65c65c65c565c65c50d3()TnL5HPStwNw-gN1OuW5VyKxMyOTAH.bK0w)()

Below is the brokered WinRT component template for VS2015 https://visualstudiogallery.msdn.microsoft.com/d2e9cac0-66a8-464a-a902-55ae765c8e6e?tduid=(c5f2776eb12ea55b8926d0c075062c9d)(256380)(2459594)(TnL5HPStwNw-gN1OuW5VyKxMyOTAH.bK0w)()

下面是为 UWP 创建代理组件的一个很好的例子,https://xamltips.wordpress.com/2015/11/13/brokered-component-for-uwp-on-windows-10/

Below is a very good example for creating brokered components for UWP, https://xamltips.wordpress.com/2015/11/13/brokered-component-for-uwp-on-windows-10/

有关详细信息,请参阅https://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx

这篇关于在 uwp 中读/写注册密钥文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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