WMI获取驱动版本

WMI获取驱动版本

 

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

posted on 2013-06-08 08:52  spinsoft  阅读(372)  评论(0编辑  收藏  举报