Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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);
                }                   
            }
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: rotation unity script 2d 
Csharp :: list to ienumerable c# 
Csharp :: how to print statement in c# 
Csharp :: C# async to sync 
Csharp :: c# convert dictionary object to string 
Csharp :: use slider in unity 
Csharp :: c# add element to array 
Csharp :: basic of c# sockets 
Csharp :: how to validate if date is a weekday or weekend c# 
Csharp :: checking a gamobjects layer 
Csharp :: how to find the tag of an objecdt in unity 
Csharp :: click in vue 
Csharp :: how to add rigidbody in unity 
Csharp :: uri file path c# 
Csharp :: msbuild publish to folder command line .net 
Csharp :: c# create excel file 
Csharp :: mvc refresh page from controller 
Csharp :: unity add button 
Csharp :: combobox selected item c# 
Csharp :: get the number of cpu c# 
Csharp :: sorting list by date time dec in c# 
Csharp :: unity model ripper 
Csharp :: c# draw rectangle on screen 
Csharp :: list sum c# 
Csharp :: how to turn components on and off in unity through code 
Csharp :: unity 2d enemy patrol script 
Csharp :: c# increment by 1 
Csharp :: c# get random index from list 
Csharp :: timer unity 
Csharp :: loop for x amount of seconds c# 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =