Export (0) Print
Expand All

PrintServer.GetPrintQueues Method (EnumeratedPrintQueueTypes[])

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)

public PrintQueueCollection GetPrintQueues (
	EnumeratedPrintQueueTypes[] enumerationFlag
)
public PrintQueueCollection GetPrintQueues (
	EnumeratedPrintQueueTypes[] enumerationFlag
)
public function GetPrintQueues (
	enumerationFlag : EnumeratedPrintQueueTypes[]
) : PrintQueueCollection
Not applicable.

Parameters

enumerationFlag

An array of values that represent the types of print queues that are in the collection.

Return Value

The 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. For the complete example, see Enumerating a Subset of Print Queues Sample.

// 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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft