EnumeratedPrintQueueTypes Enumeration (System.Printing)

Switch View :
ScriptFree
.NET Framework Class Library
EnumeratedPrintQueueTypes Enumeration

Specifies attributes of print queues.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  System.Printing
Assembly:  System.Printing (in System.Printing.dll)
Syntax

Visual Basic
<FlagsAttribute> _
Public Enumeration EnumeratedPrintQueueTypes
C#
[FlagsAttribute]
public enum EnumeratedPrintQueueTypes
Visual C++
[FlagsAttribute]
public enum class EnumeratedPrintQueueTypes
F#
[<FlagsAttribute>]
type EnumeratedPrintQueueTypes
Members

Member name Description
EnableDevQuery A print queue that holds its print jobs when the document and printer configurations do not match.
PushedMachineConnection A print queue that was installed by using the Push Printer Connections computer policy. See Remarks.
PushedUserConnection A print queue that was installed by using the Push Printer Connections user policy. See Remarks.
Queued A print queue that allows multiple print jobs in the queue.
DirectPrinting A print queue that sends a print job directly to printing instead of spooling the job first.
PublishedInDirectoryServices A print queue that is visible in the directory of printers.
WorkOffline A print queue that can work offline.
RawOnly A print queue that spools only raw data.
EnableBidi A print queue for a printer that has bidirectional communication enabled.
KeepPrintedJobs A print queue that keeps jobs in the queue after printing them.
Fax A print queue that services a fax machine.
TerminalServer A print queue that is installed by the redirection feature in Terminal Services.
Connections A print queue that is connected to the specified print server.
Shared A print queue that is shared.
Local A print queue that is installed as a local print queue on the specified print server.
Remarks

Use these values with the GetPrintQueues method to list subsets of available print queues.

PushedMachineConnection and PushedUserConnection refer to policies that enable automated connection of machines and users to printers. See the section "Deploying Printers to Users or Computers by Using Group Policy" in the Step-by-Step Guide for Print Management.

Examples

The following example shows how to use the EnumeratedPrintQueueTypes enumeration to get a subset of available print queues.

Visual Basic

			' Specify that the list will contain only the print queues that are installed as local and are shared
			Dim enumerationFlags() As EnumeratedPrintQueueTypes = {EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Shared}

			Dim printServer As New LocalPrintServer()

			'Use the enumerationFlags to filter out unwanted print queues
			Dim printQueuesOnLocalServer As PrintQueueCollection = printServer.GetPrintQueues(enumerationFlags)

			Console.WriteLine("These are your shared, local print queues:" & vbLf & vbLf)

			For Each printer As PrintQueue In printQueuesOnLocalServer
				Console.WriteLine(vbTab & "The shared printer " & printer.Name & " is located at " & printer.Location & vbLf)
			Next printer
			Console.WriteLine("Press enter to continue.")
			Console.ReadLine()


C#

// 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();


Visual C++

// Specify that the list will contain only the print queues that are installed as local and are shared
array<System::Printing::EnumeratedPrintQueueTypes>^ enumerationFlags = {EnumeratedPrintQueueTypes::Local,EnumeratedPrintQueueTypes::Shared};

LocalPrintServer^ printServer = gcnew 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");

for each (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();


Version Information

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference

Other Resources