Horje
c# get battery level Code Example
c# get battery level
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Management.ObjectQuery query = new ObjectQuery("Select * FROM Win32_Battery");
            ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);

            ManagementObjectCollection collection = searcher.Get();

            foreach (ManagementObject mo in collection)
            {
                foreach (PropertyData property in mo.Properties)
                {
                    Console.WriteLine("Property {0}: Value is {1}", property.Name, property.Value);
                }                   
            }
        }
    }
}




Csharp

Related
get ad user using email address microsoft graph C# Code Example get ad user using email address microsoft graph C# Code Example
how to use buildcontext in initstate flutter Code Example how to use buildcontext in initstate flutter Code Example
c# remove first line from textbox Code Example c# remove first line from textbox Code Example
ElevatedButton change color Code Example ElevatedButton change color Code Example
c# object is in object list Code Example c# object is in object list Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12