简体   繁体   中英

How can I get motherboard and CPU Voltage informations in C#?

As far as I research on internet, I tried some codes but it's working. it returned '0' value. My question is:How can I get motherboard and CPU Voltage informations in C#?

My code:

 //http://wutils.com/wmi/
 //create a management scope object
 ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\cimv2");

 //create object query
 ObjectQuery query = new ObjectQuery("SELECT * FROM CIM_VoltageSensor");

 //create object searcher
 ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher(scope, query);

 //get collection of WMI objects
 ManagementObjectCollection queryCollection = searcher.Get();

 //enumerate the collection.
 foreach (ManagementObject m in queryCollection) 
 {
 // access properties of the WMI object
 Console.WriteLine("Accuracy : {0}", m["Accuracy"]);

 }

查看OpenHardwareMonitor开源项目。

You may find this helpful. The explanation of the examples are here .

Look into frmMain.cs example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM