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

僅多工緩衝處理未經處理資料 (Raw Data) 的列印佇列。

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 參考可讓機器和使用者自動連線到印表機的原則。 See the section "Deploying Printers to Users or Computers by Using Group Policy" in the Step-by-Step Guide for Print Management.

適用於

另請參閱