问题
I have a windows store application which will be used on tablet devices.
The application communicates with a service every 15 minutes but when the devices is connected to a power source I'd like to it to communication with the service every minute.
So is there any way in a windows 8 store application to check if a power supply is connected?
I'm using XAML/C# for the store application.
回答1:
Currently there's no access to the Power API in WinRT. If there was, you could use the SystemInformation.PowerStatus. If you're going to need 1 min polling to a server I'd strongly recommend using SignalR and it's .NET client.
来源:https://stackoverflow.com/questions/19924049/check-if-a-windows-8-tablet-is-connected-to-a-power-supply-from-windows-8-applic