我写了下面的代码,它没有得到远程打印机的名称有人可以帮我吗?
var searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM
Win32_Printer");
var results = searcher.Get();
IList<ManagementBaseObject> printers = new List<ManagementBaseObject>();
`enter code here`
foreach (var printer in results) `enter code here`{
if ((bool)printer["Network"]) `enter code here`{`enter code here`
printers.Add(printer);`enter code here`
}
}