Dim power As PowerStatus = SystemInformation.PowerStatus
Dim percent As Single = power.BatteryLifePercent
或者
PowerStatus power = SystemInformation.PowerStatus;
float percent = power.BatteryLifePercent;
(我更喜欢 vb 答案,因为这是编写应用程序的内容,但可以转换,所以如果你不知道 vb,c# 很好)
我了解以上内容将为我提供剩余的电池百分比 - 但我有一个“可热插拔”的平板电脑(它有一个主电池,然后是一个 5 分钟的小电池,在你更换电池时运行平板电脑) - 如何我找到第二块电池的状态?
我正在寻找类似的东西,SystemInformation.PowerStatus(0)
但我不知道我实际上想要找到什么,而且我必须有一个谷歌块,因为我找不到任何东西。