你如何在.NET CF 3.5当前电池电量? [英] How do you get the current battery level in .NET CF 3.5?

查看:243
本文介绍了你如何在.NET CF 3.5当前电池电量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何 - 或者什么是最好的方式 - 以检索设备的当前电池电量在.NET CF 3.5在Windows Mobile 5和6

How - or what's the best way - to retrieve the device's current battery level in .NET CF 3.5 on Windows Mobile 5 and 6?

推荐答案

我想你想使用 Microsoft.WindowsMo​​bile.Status namepsace(特别是<一个href="http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate_properties.aspx"相对=nofollow> SystemState 类。

I think you want to use the Microsoft.WindowsMobile.Status namepsace (specifically the SystemState class.

using Microsoft.WindowsMobile.Status;

...

BatteryLevel batteryLevel = SystemState.PowerBatteryStrength;
BatteryState batteryState = SystemState.PowerBatteryState;

请参阅<一href="http://www.nullskull.com/q/10249680/how-to-get-battery-percentage-in-windows-mobile-app-using-cnet.aspx"相对=nofollow>这个帖子为全面code样本。

See this post for the full code sample.

这篇关于你如何在.NET CF 3.5当前电池电量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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