Skip to content

A "System Monitor" project using "WMI" and "Open Hardware Monitor" in C#, Second project I did to fork & a fix to an existing project, with explain

Notifications You must be signed in to change notification settings

MohammadYAmmar/WMI_Monitor_Csharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WMI_Monitor_Csharp

A "System Monitor" project using "WMI" and "Open Hardware Monitor".
Written in C-sharp by Mark Becker in 2012, fork by Mohammad Yaser Ammar in 2021

This project is my desire to experience developing my skills and supporting open source projects, this is the second project that I have been working on for GitHub!

Project fork from: https://github.com/markbecker/WMI_Monitor_Csharp

Improvements

Correcting problems to run in 2021
The project from 2012 was therefore built on libraries that need to be changed or updated, in addition to the nature of the system that was tried on Windows 7, but now this system has stopped supporting it, I have tried the changes to work in the best possible way with Windows 10.

Problems and method of fix

1 - When opening the project for the first time, we get about 116 errors, as in the picture

alt text

Do not worry, this is because the program version differed from 2010 to 2019, so the handling of libraries is a little different, the solution to this problem is simply to enter the library store (one of the advantages of Visual Studio 2019 is the ease of downloading and updating libraries) Store Picture of NuGet Packages we enter it like the image

alt text

Then we are looking to download this library as in the picture

alt text


2 - Now with these problems is to modify the method of queries in the code because an error such as

alt text

Simply the first initial solution is to make a comment when calling the method to limit the problem

alt text


3 - This problem is similar to the previous one, but I will explain the reasons for it because it depends on the device that the driver contains or not.

alt text

When opening the tool at the highest level it shows us blank information, but this is with a comment of course

alt text

To solve it, we will go through a series of steps to understand that, if you encounter a similar problem, dear reader and programmer, with WMI, how you think to solve it 🤔.

We notice here, via the tool that examines the queries for that, that the query in the code does not exist basically as in the picture (I will explain the tool in the next section)

alt text

When modifying to find the determinant by itself and a direct query is still the error, why?

alt text

If we try in another system, for example Windows Server 2019, we investigate that it works with the tool without problems, as well as if we run the program on it

alt text

The solution I think with Windows 10 is to download features of WMI and SNMP from settings

alt text

I added a temporary solution with the error handling method through try and catch so that the program does not stop running in the event that a specific query is lost. As in the picture

alt text


A utility for queries to WMI

Using a utility to scan directly on Windows devices and for queries, are they present or not before checking the code.

To enter it, run from the Windows button with the letter R. Then we call the field we want and inquire about the specific query as I explained in the picture

alt text


The explanation of the program has been completed

alt text

Soon I will add new features 🔜, so do not forget to follow the account and star to the repository ✔🌟😁


My GitHub:
https://github.com/MohammadYAmmar
My LinkedIn:
https://www.linkedin.com/in/mohammad-y-ammar/

This site is nice for writing description stackedit

Thank you for reading all of this to benefit you instead of just copying and pasting ✂!

The part in which Mohammad Yaser Ammar wrote has ended

Description of the original project without modification:

WMI_Monitor_Csharp

A "System Monitor" project using "WMI" and "Open Hardware Monitor".
Written in C-sharp by Mark Becker
    Features
    • Starts in sytem tray
    • Standalone application
    • Short and Long Form
    • Low processor usage
    • Simple to use

    Development Purpose
    • Needed better, light weight, set of system monitors used during application development.
    • Windows gadgets were not complete enough.
    • Explore C# application development in Visual Studio 2010.
    • Explore using WMI and Open Hardware Monitor.

    Developed and tested on...
    • Desktop:
      • OS - Windows 7 Professional 64-bit
      • CPU - Intel Core i5 760 @ 2.80GHz
      • MB - ASUS P7P55D-E Pro
      • VC - ATI Radeon HD 5750
    • Laptop:
      • Lenovo ThinkPad T61
      • OS - Windows 7 Professional 64-bit
      • CPU - Intel Core 2 Duo T7500
      • VC - NVIDIA Quadro NVS 140M

    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, for example System Center Operations Manager, formerly Microsoft
      Operations Manager (MOM), or Windows Remote Management
    • More info from MS

    What is Open Hardware Monitor?
    • The Open Hardware Monitor is a free open source software that monitors
      temperature sensors, fan speeds, voltages, load and clock speeds of a computer.
    • More info from OHM

    To Install...
    • Both "WMI_Monitor_Csharp" and "Open Hardware Monitor" are stand-alone applications.
    • Just click the .exe files to get running
    • The .exe location is here
      ...\WMI_Monitor_Csharp\WMI_Monitor_Csharp\bin\x64\Debug\WMI_Monitor_Csharp.exe
    • This .exe was compiled for 64 bit systems.
    • Adjust and recompile if using a 32 bit system.

    System Requirements
    • Windows OS
    • Open Hardware Monitor running in background
    • WMI is already installed in Windows systems


Screenshot 1
Click for larger

Screenshot 2
Click for larger

About

A "System Monitor" project using "WMI" and "Open Hardware Monitor" in C#, Second project I did to fork & a fix to an existing project, with explain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%