Get the manufacturer name for my RAM (WMI did not receive this information)

I need to get complete information about the RAM modules. I tried to get it using WMI:

ManagementObjectSearcher searcher12 = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PhysicalMemory"); Console.WriteLine("------------- Win32_PhysicalMemory instance --------"); foreach (ManagementObject queryObj in searcher12.Get()) { Console.WriteLine("BankLabel: {0} ; Capacity: {1} Gb; Speed: {2}; Manufacturer: {3}; Serial Number: {4}", queryObj["BankLabel"], Math.Round(System.Convert.ToDouble(queryObj["Capacity"]) / 1024 / 1024 / 1024, 2), queryObj["Speed"], queryObj["Manufacturer"], queryObj["Name"]); } 

but it didn’t help me, he just doesn’t have this information. How can I get this information?

+5
source share
1 answer

The above code works in Windows 10. I copied and pasted the above code into a console application.

I had to add a link to System.Management.

When I run it, I get the following output:

 ------------- Win32_PhysicalMemory instance -------- BankLabel: BANK 0 ; Capacity: 4 Gb; Speed: 1333; Manufacturer: Hynix; Serial Number: Physical Memory BankLabel: BANK 1 ; Capacity: 4 Gb; Speed: 1333; Manufacturer: Unknown; Serial Number: Physical Memory 
0
source

Source: https://habr.com/ru/post/1261012/


All Articles