c# - UWP 从后台任务中读取注册表并将信息反馈给 UI
问题描述
我有点卡住了,需要关于几个问题的建议。我正在开发一个 UWP 应用程序以 toast 和活动磁贴的形式发送用户通知
在我的解决方案中,我添加了Windows 运行时组件(通用 Windows),它在时间触发器上执行后台任务。
我要解决的问题(到目前为止还没有运气)
- 后台任务可以读取注册表或 WMI 吗?有可能吗?
- 当用户打开/重新打开应用程序时,如何连接回我的后台任务以获取收集的数据
解决方案
Can Background Task read registry or WMI? is it possible at all?
For security reason, UWP does not provide such api to access registry directly, The only way is that indirectly access registry with Win32 process from uwp. You can read registry values from a Win32 runFullTrust process launched from a UWP application
How could I connect back to my background tasks to get the collected data when a user opens / re-opens the app
You have many way to send the value back to UWP platform, such as store the key into app's local storage and retrieve from UWP platform, Or use AppService to communicate desktop extension and uwp client. For more please refer this document.
推荐阅读
- orchard-modules - 除了默认位置(例如将它们放在子文件夹中)之外,还有什么方法可以管理形状模板?
- python - Pandas 中未索引数据的累积总和(按日期)
- sql - SQL Server Profiler 在 SQL Server Management Studio 工具中不可用
- vba - 取消突出显示文本(并保留所有其他字体设置)
- android - 切换活动时屏幕自动变暗
- artifactory - Artifactory REST API 在查询自己的存储库时给出了禁止的 403 错误
- javascript - 在html中打开多个窗口
- javascript - 选中复选框时在表中添加 Textfieds 使用 Jquery
- html - CSS 仅使用 flexbox 显示/隐藏内容
- python - 当我使用 VPN 时,Selenium(使用 Python)没有启动