我想知道有没有办法通过c#代码知道笔记本电脑的电池是否已充满电,或者电池已满时是否有任何事件被提起。
i want to know is there any way to know by c# code that laptop's battery is fully charged or is there any event raised when the battery is full.
最满意答案
我猜你可以使用WMI类Win32_Battery 。
有多个字段可能有用 - DesignCapacity , BatteryStatus , FullChargeCapacity或ExpectedLife
所以我的猜测是你可以使用WMI读取这两个值,然后计算FullChargeCapacity/BatteryStatus/DesignCapacity/ExpectedLife来查找电池健康百分比数字。
I'm guessing you could use the WMI class Win32_Battery.
There are multiple fields that could be useful - DesignCapacity, BatteryStatus, FullChargeCapacity or ExpectedLife
So my guess is that you can use WMI to read these two values, and then calculate FullChargeCapacity/BatteryStatus/DesignCapacity/ExpectedLife to find the battery health percentage number.
更多推荐
发布评论