Check if a windows 8 tablet is connected to a power supply from windows 8 application

不羁岁月 提交于 2019-12-13 05:51:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!