2
A
回答
9
你可以试试这个代码
Dim power As SystemInformation.PowerStatus = SystemInformation.PowerStatus
Dim percent As Single = power.BatteryLifePercent
MsgBox("Percent battery life remaining: " & percent * 100)
6
查看SystemInformation类,更具体地说,PowerStatus属性(它返回PowerStatus class的实例)。
下面的代码会给你当前的电池信息:
Dim powerstatus As PowerStatus = SystemInformation.PowerStatus
' Gets the current battery charge status.
MessageBox.Show("BatteryChargeStatus : " & powerstatus.BatteryChargeStatus)
' Gets the reported full charge lifetime of the primary battery power source in seconds.
MessageBox.Show("BatteryFullLifetime : " & powerstatus.BatteryFullLifetime)
' Gets the approximate amount of full battery charge remaining.
MessageBox.Show("BatteryLifePercent : " & powerstatus.BatteryLifePercent)
' Gets the approximate number of seconds of battery time remaining.
MessageBox.Show("BatteryLifeRemaining : " & powerstatus.BatteryLifeRemaining)
' Gets the current system power status.
MessageBox.Show("PowerLineStatus : " & powerstatus.PowerLineStatus)
相关问题
- 1. 适用于Android的笔记本电脑/笔记本电脑
- 2. 在我的笔记本电脑中伪造电池信息
- 3. 电池的使用寿命
- 4. 检查我的笔记本电脑上的C++版本
- 5. 从java监控笔记本电脑或笔记本电脑电源
- 6. GPS位置记录电池寿命
- 7. 从笔记本电脑
- 8. 为什么我的笔记本电脑
- 9. 阅读笔记本电脑当前的电池充电/放电速率
- 10. 如何检测笔记本电脑在.NET电池上运行的时间?
- 11. Android registerListener和电池寿命
- 12. Java代码来监视笔记本电脑的电池或电源
- 13. 使用mediaDevices.getUserMedia在笔记本电脑上
- 14. 平板电脑上的不同视图比笔记本电脑
- 15. 检测设备是否被用作笔记本电脑或平板电脑
- 16. Spyder的笔记本电脑的Python 2.7
- 17. IPython的笔记本电脑连接到外部的笔记本
- 18. 从Jupyter笔记本电脑上的Windows
- 19. 读取笔记本电脑电池状态的浮点/双精度
- 20. 如何在Windows中访问笔记本电脑的电池温度?
- 21. 如何检查Jupyter通过命令行运行的笔记本电脑
- 22. BlueCove,笔记本电脑,并与蓝牙Android平板电脑
- 23. 该域名不存在电脑,笔记本电脑
- 24. 我可以使用我的笔记本电脑的手机gps
- 25. 计算iOS中的电池寿命
- 26. 预测电池寿命的算法
- 27. 的Android FusedLocationProvider和电池寿命
- 28. 在笔记本电脑和主电脑上同步我的工作?
- 29. MySQL复制笔记本电脑
- 30. 笔记本电脑回环问题
这里是现成的代码 - http://syntaxhelp.com/VB.NET/Retrieve - 电池 - 信息 – 2012-04-27 08:57:29