你如何在.NET CF 3.5当前电池电量?电池电量、如何在、CF、NET

2023-09-04 00:27:58 作者:美人残

如何 - 或者什么是最好的方式 - 以检索设备的当前电池电量在.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(特别是 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;

请参阅这个帖子为全面code样本。

See this post for the full code sample.