wmi c# - WMI 给出不正确的电压读数 [英] wmi c# - WMI Giving Incorrect Voltage Readings

查看:38
本文介绍了wmi c# - WMI 给出不正确的电压读数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我用WPF、C#和WMI做了一个程序作为一个小项目来收集电脑的规格,把它放在SourceForge上,因为它对我来说没什么用.
我很快发现 SoftPedia 已经把它捡起来了,并在他们的屏幕截图中注意到电压读数有误.这是从他们的页面上剪下的图像:

So I made a program with WPF, C# and WMI as a small project to gather the specifications of a computer, and put it on SourceForge because it was of little use to me.
I soon discovered that SoftPedia had picked it up, and noticed in their screenshot that there was an error with the voltage reading. This is an image nicked from their page:

http://i.stack.imgur.com/8QpBq.png

目前我使用CurrentVoltage"来提供电压,例如

At the moment I source the voltage by using "CurrentVoltage", e.g.

foreach (var item in new ManagementObjectSearcher("Select * from Win32_Processor").Get())
{
    labelName.Content = (decimal.Parse(item["CurrentVoltage"].ToString()) / 10).ToString() + " v";
}

正如您在图片中看到的,图片中的读数为 0v.我想知道是否需要将CurrentVoltage"切换为VoltageCaps",或者是否需要执行诸如直接读取 SMBIOS 之类的操作.

As you can see in the image, it's reading as 0v in the picture. I was wondering if I would need to switch "CurrentVoltage" to "VoltageCaps", or if I would need to do something like reading the SMBIOS directly.

如果是后者,请说明如何操作,谢谢.

If the latter, please specify how to do so, thanks.

推荐答案

基于 Win32_Processor 类:

处理器的电压.如果设置了第 8 位,则第 0-6 位包含乘以 10 的电压.如果未设置第 8 位,则VoltageCaps 中的位设置表示电压值.CurrentVoltage 仅在 SMBIOS 指定电压值时设置.

Voltage of the processor. If the eighth bit is set, bits 0-6 contain the voltage multiplied by 10. If the eighth bit is not set, then the bit setting in VoltageCaps represents the voltage value. CurrentVoltage is only set when SMBIOS designates a voltage value.

这意味着,如果在使用 0x80 屏蔽时读取为 0,那么您应该使用 VoltageCaps 中的值来声明"电压作为 VoltageCaps 的 3 个列出值之一,除非查询结果为 NULL,在这种情况下电压未知.

This means that if it reads as 0 when masked with 0x80, then you should use the value from VoltageCaps to 'state' the voltage as one of the 3 listed values for VoltageCaps, unless the result of querying is NULL, in which case the voltage is unknown.

这篇关于wmi c# - WMI 给出不正确的电压读数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆