如何访问 UWP 应用中的注册表项? [英] How to access registry key in a UWP app?

查看:24
本文介绍了如何访问 UWP 应用中的注册表项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 UWP 应用访问 windows10 注册表项.键为:HKEY_LOCAL_MACHINESOFTWAREMyCompanyNameMyName我找不到任何函数调用来完成它.请指出我该怎么做?谢谢,

I would like to access windows10 registry key by a UWP app. key as: HKEY_LOCAL_MACHINESOFTWAREMyCompanyNameMyName I can not find any function call to accomplish it. Please indicate me How to do it? Thank you,

推荐答案

您可以从从 UWP 应用程序启动的 Win32 runFullTrust 后台进程读取注册表值,并且您可以在 HKEY_LOCAL_MACHINE 配置单元中写入值,来自从该 runFullTrust 进程启动的提升的"Win32 应用程序.

You can read registry values from a Win32 runFullTrust background process launched from a UWP application, and you can write values in the HKEY_LOCAL_MACHINE hive from an "elevated" Win32 application launched from that runFullTrust process.

这些技术非常强大,在从 Windows 应用商店部署的 UWP 应用中使用它们需要经过 Microsoft 的特别审查和许可.这些技术由原始设备制造商使用,但不仅限于它们.如果你有充分的理由并且能够解释它,你很可能会获得批准.

These techniques are powerful and using them in a UWP app deployed from the Windows Store requires special scrutiny and permission from Microsoft. The techniques are used by OEMs, but not exclusively restricted to them. If you have a good reason and are able to explain it, you're likely to get approval.

我写了一个示例和文章,确切地展示了如何做到这一点,你可能会发现它此处.

I have written a sample and article that shows exactly how to do this, and you may find it here.

这篇关于如何访问 UWP 应用中的注册表项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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