How do you get the current battery level in .NET CF 3.5?

后端 未结 3 1764
说谎
说谎 2020-12-17 06:49

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?

3条回答
  •  遥遥无期
    2020-12-17 07:15

    You probably want the State Notification Broker class that Noldorin is recommending. I don't think it gives you very fine grain information. You get information like Low or Very Low. If you need specific percentages consider using GetSystemPowerStatusEx.

    HOWTO: Get the Device Power Status GetSystemPowerStatusEx

提交回复
热议问题