[Solved] Battery Status in winforms
I thing that what you want to do is this: private void BatteryStatus() { System.Management.ManagementClass wmi = new System.Management.ManagementClass(“Win32_Battery”); var allBatteries = wmi.GetInstances(); foreach (var battery in allBatteries) { int estimatedChargeRemaining = Convert.ToInt32(battery[“EstimatedChargeRemaining”]); label13.Text = “Remaining:” + ” ” + estimatedChargeRemaining + ” ” + “%”; } } No need for and if statment, the … Read more