检查 Windows 8 平板电脑是否从 Windows 8 应用程序连接到电源 [英] Check if a windows 8 tablet is connected to a power supply from windows 8 application

查看:27
本文介绍了检查 Windows 8 平板电脑是否从 Windows 8 应用程序连接到电源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将在平板设备上使用的 Windows 商店应用程序.

I have a windows store application which will be used on tablet devices.

应用程序每 15 分钟与服务通信一次,但当设备连接到电源时,我希望它每分钟与服务通信一次.

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.

Windows 8 商店应用程序中是否有任何方法可以检查电源是否已连接?

So is there any way in a windows 8 store application to check if a power supply is connected?

我将 XAML/C# 用于商店应用程序.

I'm using XAML/C# for the store application.

推荐答案

目前无法访问 WinRT 中的 Power API.如果有,您可以使用 SystemInformation.PowerStatus.如果您需要对服务器进行 1 分钟轮询,我强烈建议您使用 SignalR 并且它是 .NET 客户端.

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.

这篇关于检查 Windows 8 平板电脑是否从 Windows 8 应用程序连接到电源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆