我正在尝试复制下面的确切文件列表,该列表位于设备管理器的“驱动程序详细信息”下,我提出了以下代码,但我无法显示此列表。任何帮助都很棒。
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPSignedDriver");
foreach (ManagementObject obj in searcher.Get())
{
if(obj["DriverProviderName"] != null)
foreach (PropertyData prop in obj.Properties)
{
File.AppendAllText(@"C:\driverusers.txt", prop.Name +"\t" +prop.Value+"\n");
Console.WriteLine("{0}: {1}", prop.Name, prop.Value);
}
}