c# - How to retrieve dual batteries status? -
dim power powerstatus = systeminformation.powerstatus dim percent single = power.batterylifepercent
or
powerstatus power = systeminformation.powerstatus; float percent = power.batterylifepercent;
(i prefer vb answer application written in can convert c# fine if dont know vb)
i understand above give me battery percentage remaining - have tablet 'hot swappable' (it has main battery small 5 minute battery runs tablet while swap batteries on it) - how find status of second battery?
i looking systeminformation.powerstatus(0)
have no idea trying find , must having google block cannot find anything.
you can use wmi , win32 battery levels.
try this:
objectquery query = new objectquery("select * win32_battery"); foreach (managementobject o in new managementobjectsearcher(query).get()) { uint level = (uint)o.properties["estimatedchargeremaining"].value; }
Comments
Post a Comment