2
我已經寫了下面的代碼,它沒有得到遠程打印機名稱任何人都可以幫我嗎?如何獲得C#中的所有網絡打印機#
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`
}
}