阅读安装的设备驱动程序详细信息(版本,安装日期,路径等),WIN系统 [英] Read Installed Device Driver Details (version, install date, path etc), on Win system
问题描述
谁能帮助,请在这方面?
什么的API可以从Win32的用于获取安装设备驱动程序的细节,如
版本,安装日期,路径在哪里设置?
Can anyone help please in this regard ? What API's can be used from win32 to get installed device drivers details like version, installation date, path where installed ?
问候,
基达
推荐答案
最好的办法是WMI,用.NET System.Management命名空间支持很好。您将要使用 Win32_SystemDriver WMI类。我复制并从<粘贴的这个code href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en\"相对=nofollow> WMI codeCreator ,一个伟大的工具进行实验并自动生成的code你需要:
The best way is WMI, .NET supports it well with the System.Management namespace. You'll want to use the Win32_SystemDriver WMI class. I copied and pasted this code from WMICodeCreator, a great tool to experiment and auto-generate the code you need:
using System;
using System.Management; // Project + Add Reference required
public class MyWMIQuery {
public static void Main() {
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_SystemDriver");
foreach (ManagementObject queryObj in searcher.Get()) {
Console.WriteLine("Driver caption: {0}", queryObj["Caption"]);
}
Console.ReadLine();
}
}
看看我留在这个帖子中的链接,Win32_SystemDriver已经超越标题。
Check out the links I left in this post, Win32_SystemDriver has many other properties beyond "Caption".
这篇关于阅读安装的设备驱动程序详细信息(版本,安装日期,路径等),WIN系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!