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