开发者

how can I get driver's version of Network Adapter ? by c# code?

开发者 https://www.devze.com 2023-01-09 09:23 出处:网络
h开发者_StackOverflow中文版ow can I getdriver\'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, especial

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();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消