Get network printers

56 Views Asked by At

I need to detect the network printers on my PC. I tried this method:

PrintQueueCollection networkQueues;

using (var printServer = new PrintServer())
{
    var flags = new[] { EnumeratedPrintQueueTypes.Shared, EnumeratedPrintQueueTypes.Connections };
    networkQueues = printServer.GetPrintQueues(flags);
}

result network queues

But they are not detected. Yet I have two network printers, detectable with this code:

var printerNames = PrinterSettings.InstalledPrinters;

all my installed printers

0

There are 0 best solutions below