简体   繁体   中英

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

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM