PrintServer.GetPrintQueues Method (EnumeratedPrintQueueTypes[])
.NET Framework 4.5
Gets the collection of print queues of the specified types that are named in EnumeratedPrintQueueTypes and hosted by the print server.
Namespace: System.Printing
Assembly: System.Printing (in System.Printing.dll)
Parameters
- enumerationFlag
- Type: System.Printing.EnumeratedPrintQueueTypes[]
An array of values that represent the types of print queues that are in the collection.
Return Value
Type: System.Printing.PrintQueueCollectionThe PrintQueueCollection of print queues, of the specified types, on the print server.
The following example shows how to use this method to get a subset of available print queues.
// Specify that the list will contain only the print queues that are installed as local and are shared EnumeratedPrintQueueTypes[] enumerationFlags = {EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Shared}; 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:\n\n"); foreach (PrintQueue printer in printQueuesOnLocalServer) { Console.WriteLine("\tThe shared printer " + printer.Name + " is located at " + printer.Location + "\n"); } Console.WriteLine("Press enter to continue."); Console.ReadLine();
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.