Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMBIOS - Get SPD (Serial Presence Detect) Modules Information C#

Tags:

c#

I searched a lot but did not find any working codes getting SPD tables information via C#. Out there there are lots of softwares which get this info but HOW?

enter image description here

as shown in the image, for RAM devices, you can see Manufacture's name which can not be retrieve at all by WMI etc

If there is a DLL for using in C# will be perfect also

After some Research found this:

https://github.com/sapozhnikovay/SMBIOS

but it can not read table 17 to get memory device information.

like image 980
Inside Man Avatar asked Feb 10 '17 19:02

Inside Man


2 Answers

Once I was researching about this, you need to get this information through SMBUS (not SMBIOS). But you need to create a driver (WDM in C/C++) to access this information.

like image 145
Daldegam Avatar answered Oct 22 '22 14:10

Daldegam


Make sure you have added System.Management as a reference.

Here is a string that will return almost any information you want from the component :

private string getComponent(string hwClass, string syntax)
    {
        ManagementObjectSearcher mos = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM " + hwClass);
        foreach (ManagementObject mj in mos.Get())
        {
            return Convert.ToString(mj[syntax]);
        }
        return null;
    }

Using the string would look like this, say on a button click :

label1.Text = getComponent("Win32_PhysicalMemory", "SerialNumber");

I tested it and it returned a serial number, you can also look at the list of things you can put in like manufacturer, name, capacity etc.

I got all of this information from this YouTube video.

You can find all of the devices and their properties here (CPU, GPU, etc.)

like image 1
Unknown Avatar answered Oct 22 '22 14:10

Unknown