Member-only story
💻 — 🔋Get Laptop Battery Name and Battery Power Status using C# Console Application
First of all, Let me just explain to you in short about WMI & Win32_Battery!
What is WMI?
Windows Management Instrumentation(WMI) is the infrastructure for management data and operations on Windows-based operating systems.
You can write WMI scripts or applications to automate administrative tasks on remote computers but WMI also supplies management data to
other parts of the operating system and products.
What is the Win32_Battery Class?
The Win32_Battery WMI Class represents a battery connected to the computer system.
Let’s create a simple Console Application in Visual Studio
Click on Next -> Button
Give a sample solution name and then click on Create -> Button.
Add the System. Management package into our project.
System.Management Namespace:
project Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the windows management Instrumentation(WMI) infrastructure. Applications and services can query for interesting management information (such…