wmi c# - WMI 给出不正确的电压读数

发布于 2024-12-21 17:05:07 字数 645 浏览 0 评论 0原文

所以我用 WPF、C# 和 WMI 编写了一个程序作为一个小项目来收集计算机的规格,并将其放在 SourceForge 上,因为它对我来说没什么用处。
我很快发现 SoftPedia 已经发现了它,并在他们的屏幕截图中注意到电压读数有错误。这是从他们的页面上截取的图像:

https://i.sstatic.net/8QpBq.png

目前,我使用“CurrentVoltage”来获取电压,例如

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 之类的操作。

如果是后者,请具体说明如何操作,谢谢。

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:

https://i.sstatic.net/8QpBq.png

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";
}

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦开始←不甜 2024-12-28 17:05:07

基于 Win32_Processor 的文档类:

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

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

Based on the documentation for the Win32_Processor class:

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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文