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