访问主板信息而不使用WMI [英] Access Motherboard information without using WMI

查看:181
本文介绍了访问主板信息而不使用WMI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的应用程序中访问motheroard标识(串行,制造等)在多个进程。



如果你想知道情况: / p>

我有一些应用程序行为,这取决于硬件配置,或者如果设置了特定的环境变量(用于测试目的)。

  bool IsVideoCardDisplay =(getenv(Z_VI_DISPLAY)||!QueryWmiForSpecialBoard())? false:true; 

设置环境变量时,不需要WMI查询 - 应用程序运行良好。但是,当环境变量不存在时,我的应用程序的一些组件无法启动,当需要进行WMI查询时。我怀疑可能有一些WMI调用的副作用(每个进程最多只发生一次,这就是为什么我寻求一种替代方法。

解决方案

显然没有办法这样做,这是不幸的。


I need to access motheroard identification (serial, manufacture, etc) in my application on multiple processes. I have been able to successfully query this using WMI, but I'm looking for an alternative.

If you care to know situation:

I have some application behavior that is different depending on the hardware configuration, or if a particular environment variable is set (for testing purposes).

bool IsVideoCardDisplay = ( getenv("Z_VI_DISPLAY") || !QueryWmiForSpecialBoard() ) ? false : true;

When the environment variable is set the WMI query isn't necessary--the application runs fine. However, when the environment variable is not present some of the components of my app fail to launch when is necessary to make the the WMI queries. I suspect that there may be some side effects of the WMI calls (which only a maximum of happen once per processes. This is why I'm seeking an alternative way.

解决方案

Apparently there is no way to do this, which is unfortunate.

这篇关于访问主板信息而不使用WMI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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