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开源项目。
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.