关于使用WMI中的Win32_PnPSignedDriver类的不解
在咱们坛子里面看见一个使用WMI中的Win32_PnPSignedDriver类来查询设备驱动信息的帖子,他代码如下
private string GetDriverVersion( string hardwareID )
{
string queryString = "SELECT HardwareID, DriverVersion FROM Win32_PnPSignedDriver";
SelectQuery selectQuery = new SelectQuery( queryString );
ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery);
foreach (ManagementObject mo in searcher.Get())
{
object tempID = mo["HardwareID"];
if( tempID!=null && tempID.ToString().ToUpper() == hardwareID.Trim().ToUpper() )
{
return mo["DriverVersion"].ToString();
}
}
return "UnknownVersion";
}
上面的hardwareID参数从哪里获得,我找了很多资料,都查不到,烦请各位牛人给解决哈
------解决方案--------------------好像坛子里面有个源码可以下载