简体   繁体   English

如何在C#中获取主板和CPU电压信息?

[英]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. 它返回了“ 0”值。 My question is:How can I get motherboard and CPU Voltage informations in C#? 我的问题是:如何在C#中获取主板和CPU电压信息?

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. 查看frmMain.cs示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C# - 如何使用 LibreHardwareMonitor 获取 CPU 温度/CPU 负载/当前电压/VID 电压/当前频率? - C# - How to get a CPU Temp / CPU Load / Current Voltage / VID Voltage / Current Frequency with LibreHardwareMonitor? 如何在C#中获取主板传感器读数 - How to get motherboard sensor readings in C# 如何在C#中创建textBox后使用信息 - How can i use informations after create textBox in C# 如何在 C# 中获得每个内核的 CPU 负载? - How can I get CPU load per core in C#? 如何从c#应用程序获得远程linux机器的cpu和ram使用 - How can I get cpu and ram usage of remote linux machine from c# application 如何在C#(托管代码)中获得* THREAD *的CPU使用率和/或RAM使用率? - How can I get CPU usage and/or RAM usage of a *THREAD* in C# (managed code)? 如何获取已安装的 RAM 和 CPU 详细信息 c#.Net Core? - How I can get the installed RAM and CPU details c# .Net Core? 如何获得CPU插槽类型? (C#) - How do I get the CPU socket type? (C#) C# 有时 CPU 的 ID 得到零字符串,并且主板 ID 是空字符串 - C# sometimes ID of CPU gets string of Zeros and also Motherboard ID is empty string 如何将 CPU 内核限制为 C# 中的特定线程 - How Can I Limit CPU core to specific thread in C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM