问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/53562402/how-to-get-the-value-of-advanced-power-settings