другое дело - как @SajithSageer предложил в комментариях выше ( на основе этой ссылки ):
я удалил 1 из 2 моих сетевых принтеров , 1 HP и 1 пушку - которые оба были найдены в моей сети WiFi и также установлены оттуда, и получили следующие результаты:
1. ни один из них не «ОБЩЕН» - они всегда «МЕСТНЫ»
2. когда пушка подключена - она также появляется на «EnableBidi»
3. EnumeratedPrintQueueTypes = 512 не существует - но дает результаты :)
вот код:
for (int i = 0; i < 20; i++)
{
EnumeratedPrintQueueTypes[] enumerationFlags = { (EnumeratedPrintQueueTypes)Math.Pow(2,i)};
LocalPrintServer printServer = new LocalPrintServer();
//Use the enumerationFlags to filter out unwanted print queues
PrintQueueCollection printQueuesOnLocalServer = printServer.GetPrintQueues(enumerationFlags);
Console.WriteLine("These are your shared, local print queues:\t {0}\n---------------------------\n", enumerationFlags[0]);
foreach (PrintQueue printer in printQueuesOnLocalServer)
{
Console.WriteLine("\t" + printer.Name );
}
Console.WriteLine();
}
вот результаты:
These are your shared, local print queues: Queued
---------------------------
These are your shared, local print queues: DirectPrinting
---------------------------
These are your shared, local print queues: 4
---------------------------
These are your shared, local print queues: Shared
---------------------------
These are your shared, local print queues: Connections
---------------------------
These are your shared, local print queues: 32
---------------------------
These are your shared, local print queues: Local
---------------------------
OneNote
Send To OneNote 2016
Microsoft XPS Document Writer
Microsoft Print to PDF
HP872916 (HP OfficeJet Pro 7740 series)
Fax - HP OfficeJet Pro 7740 series
Fax
These are your shared, local print queues: EnableDevQuery
---------------------------
These are your shared, local print queues: KeepPrintedJobs
---------------------------
These are your shared, local print queues: 512
---------------------------
Send To OneNote 2016
Microsoft XPS Document Writer
Microsoft Print to PDF
HP872916 (HP OfficeJet Pro 7740 series)
These are your shared, local print queues: WorkOffline
---------------------------
These are your shared, local print queues: EnableBidi
---------------------------
These are your shared, local print queues: RawOnly
---------------------------
These are your shared, local print queues: PublishedInDirectoryServices
---------------------------
These are your shared, local print queues: Fax
---------------------------
Fax
These are your shared, local print queues: TerminalServer
---------------------------
These are your shared, local print queues: 65536
---------------------------
These are your shared, local print queues: PushedUserConnection
---------------------------
These are your shared, local print queues: PushedMachineConnection
---------------------------
These are your shared, local print queues: 524288
---------------------------
Press enter to continue.