I am developing a program that depends on controlling the battery level of a computer.
This is the C # code I'm using:
PowerStatus pw = SystemInformation.PowerStatus; if (pw.BatteryLifeRemaining >= 75) {
My unsuccessful attempt to the while statement, it uses all the unwanted CPUs.
int i = 1; while (i == 1) { if (pw.BatteryLifeRemaining >= 75) {
How to control this constantly with an infinite loop, so that when it reaches 75%, it will execute some code.
source share