h开发者_StackOverflow中文版ow can I get driver's version of Network Adapter ? by c# code?
You should be able to do it via WMI. The Win32_PnPSignedDriver class looks like a good place to start, especially the DriverVersion
property.
I think something like this might work (please note, this code is completely untested and is just an educated guess on how it might work):
using System.Management;
...
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPSignedDriver");
foreach(ManagementObject obj in searcher.Get())
{
// loop until you find the driver you're looking for (Hopefully you can distinguish this by the DeviceName, DriverName or FriendlyName)
string version = obj.GetPropertyValue("DriverVersion").ToString();
}
精彩评论