检查 Windows 8 平板电脑是否从 Windows 8 应用程序连接到电源

编程入门 行业动态 更新时间:2024-10-27 14:32:12
本文介绍了检查 Windows 8 平板电脑是否从 Windows 8 应用程序连接到电源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个将在平板设备上使用的 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-25 18:19:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1120975.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   平板   应用程序   电源   电脑

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!