问题描述
我尝试在我的 UWP 应用程序上读取/获取那些高级设置值,例如让计算机进入睡眠状态,并按照这篇文章
我认为这不容易实现.没有公开的开箱即用 API 来检索此类数据.至少不是根据这个文档.>
我很确定您需要处理 native互操作性(又名DllImport
).查看这篇文章,了解如何检索此类数据并将其用作检索您感兴趣的数据的指南
I try to read/get those advanced settings values such as Put the computer to sleep on my UWP application and follow this article How to get the value of advanced power settings but in UWP it is not working because the example is only for Windows 8.1 and WPF.
Anybody have tried this kind of features in their application?
My goal only for this is to get the values from the corresponding settings.
I don't think it's easily achievable. There's no out of the box API exposed to retrieve such data. Not according to to this document at least.
I'm pretty sure you would need to deal with the native interoperability (aka DllImport
). Check this post on how to retrieve this kind of data and use it as a guideline to retrieve data that you're interested in
这篇关于如何获取高级电源设置的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!