Giter VIP home page Giter VIP logo

hardwareproviders's Introduction

Hardware Providers

Collection of libraries to explore hardware installed on the machine and relative parameters, including: clock, voltages and temperatures. For Dotnet Standard and 4.6

Component Purpose Standard .Net 4.6
HardwareProviders Contains base classes and interface to read and write directly on pc ports
HardwareProviders.CPU Retrieves Intel and AMD processors installed and relative values
HardwareProviders.GPU Retrieves Nvidia and ATI graphic cards installed and relative values June 2018 June 2018
HardwareProviders.Cooling Retrieves installed cooling devices and fans June 2018 June 2018
HardwareProviders.HDD Retrieves hard drives and relative values July 2018 July 2018

This project contains code extracted from Open Hardware Monitor and is released under the same license

CPU library Usage

Retrieving information about the current state of CPUs is incredibly simple.

TROUBLESHOOTING: Depending on Windows version you may need to run it as administrator to retrieve all values.

using System;
using System.Collections.Generic;
using System.Linq;
using HardwareProviders;
using HardwareProviders.CPU;

namespace Maddalena
{
    public class Program
    {
        static string SensorsToString(IEnumerable<Sensor> sensors) => string.Join(" ", sensors?.Select(x => x.ToString()) ?? new string[0]);

        public static void Main(string[] args)
        {
            var cpus = new CpuCollection();

            while (true)
            {
                //Read current values of every vpu
                cpus.Update();

                foreach (var cpu in cpus)
                {
                    Console.WriteLine("CPU {0} by {1}", cpu.Name, cpu.Vendor);

                    Console.WriteLine("Bus clock {0}", cpu.BusClock);
                    Console.WriteLine("Core temperatures {0}", SensorsToString(cpu.CoreTemperatures));
                    Console.WriteLine("Core powers {0}", SensorsToString(cpu.CorePowers));
                    Console.WriteLine("Core clocks {0}", SensorsToString(cpu.CoreClocks));

                    Console.WriteLine();
                    Console.WriteLine("Core loads {0}", SensorsToString(cpu.CoreLoads));
                    Console.WriteLine("Total load {0}", cpu.TotalLoad);
                }

                Task.Delay(1000).Wait();
            }
        }
}

hardwareproviders's People

Contributors

moellerm avatar phyxion avatar werelds avatar phyxionnl avatar lordofdoom avatar darthdestroyer avatar dwilhelm avatar aquacomputer avatar maddimax avatar minercrafter avatar rmattuschka avatar dernerv avatar hirschmann avatar seckar avatar cobrafast avatar shrddr avatar kurdtkobain avatar jesterret avatar ivanatpr avatar tpruvot avatar nlurski avatar beele avatar valpackett avatar dougvj avatar deveee avatar ddrboxman avatar cmoetzing avatar akc-kyiv avatar azachert avatar aeronaut avatar

Watchers

Tomny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.