EnumeratedPrintQueueTypes 枚举

定义

指定打印队列的特性。

此枚举支持其成员值的按位组合。

public enum class EnumeratedPrintQueueTypes
[System.Flags]
public enum EnumeratedPrintQueueTypes
[<System.Flags>]
type EnumeratedPrintQueueTypes = 
Public Enum EnumeratedPrintQueueTypes
继承
EnumeratedPrintQueueTypes
属性

字段

Connections 16

连接到指定打印服务器的打印队列。

DirectPrinting 2

直接将打印作业发送到打印,而不是先发送到后台打印作业的打印队列。

EnableBidi 2048

已启用双向通信的打印机的打印队列。

EnableDevQuery 128

当文档和打印机配置不匹配时停止其打印作业的打印队列。

Fax 16384

服务于传真机的打印队列。

KeepPrintedJobs 256

打印完作业后将其保留在队列中的打印队列。

Local 64

作为本地打印队列安装在指定打印服务器上的打印队列。

PublishedInDirectoryServices 8192

打印机目录中可看见的打印队列。

PushedMachineConnection 262144

使用“推入打印机连接”计算机策略安装的打印队列。

PushedUserConnection 131072

使用“推入打印机连接”用户策略安装的打印队列。

Queued 1

允许队列中存在多个打印作业的打印队列。

RawOnly 4096

仅对原始数据进行后台处理的打印队列。

Shared 8

共享的打印队列。

TerminalServer 32768

通过“终端服务”中的重定向功能安装的打印队列。

WorkOffline 1024

可脱机工作的打印队列。

示例

以下示例演示如何使用 EnumeratedPrintQueueTypes 枚举获取可用打印队列的子集。

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

注解

将这些值与 方法一起使用 GetPrintQueues ,以列出可用打印队列的子集。

PushedMachineConnectionPushedUserConnection ,请参阅启用计算机和用户到打印机的自动连接的策略。 请参阅打印管理的分步指南中的“使用组策略将打印机部署到用户或计算机”部分。

适用于

另请参阅