PrintQueue 類別

定義

管理印表機和列印工作。Manages printers and print jobs.

public ref class PrintQueue : System::Printing::PrintSystemObject
public class PrintQueue : System.Printing.PrintSystemObject
type PrintQueue = class
    inherit PrintSystemObject
Public Class PrintQueue
Inherits PrintSystemObject
繼承

備註

物件的某些屬性 PrintQueue 代表在電腦上執行之列印佇列公用程式的特性,但其他內容代表印表機本身的功能或狀態。Some properties of the PrintQueue object represent characteristics of the print queue utility that runs on the computer, but others represent features or states of the printer itself. 例如, NumberOfJobs 是列印佇列的特性,但 Location 是印表機的屬性。For example, NumberOfJobs is a characteristic of the print queue, but Location is a property of the printer. 印表機的許多屬性(例如是否需要使用者注意)都必須透過 Refresh 方法(從印表機本身到物件)傳遞 PrintQueueMany of the properties of the printer, such as whether it needs user attention, need to be passed, by means of the Refresh method, from the printer itself to the PrintQueue object. 這應該會在您的程式讀取對應的屬性 () 之前完成 NeedUserInterventionThis should be done before the corresponding property (NeedUserIntervention) is read by your program. 同樣地,當程式變更物件的一或多個屬性值時, PrintQueue 必須將變更寫入電腦上的實際列印佇列公用程式。Similarly, when your program changes the values of one or more properties of a PrintQueue object, the change must be written to the actual print queue utility on the computer. 請使用方法來這麼做 CommitDo this with the Commit method.

警告

System.Printing Windows 服務或 ASP.NET 應用程式或服務中,不支援使用命名空間內的類別。Classes within the System.Printing namespace are not supported for use within a Windows service or ASP.NET application or service. 嘗試從其中一個應用程式類型中使用這些類別可能會產生未預期的問題,例如服務效能降低和執行時間例外狀況。Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.

如果您想要從 Windows Forms 應用程式列印,請參閱 System.Drawing.Printing 命名空間。If you want to print from a Windows Forms application, see the System.Drawing.Printing namespace.

建構函式

PrintQueue(PrintServer, String)

使用指定的 PrintQueue 和佇列名稱,初始化 PrintServer 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer and queue name.

PrintQueue(PrintServer, String, Int32)

使用指定的 PrintQueue、佇列名稱和列印結構描述版本,初始化 PrintServer 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and print schema version.

PrintQueue(PrintServer, String, Int32, PrintSystemDesiredAccess)

使用指定的 PrintQueue、佇列名稱、列印結構描述版本和想要的存取權限,初始化 PrintServer 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, print schema version, and desired access.

PrintQueue(PrintServer, String, PrintQueueIndexedProperty[])

使用指定的 PrintQueue、佇列名稱和要初始化的 PrintServer 值陣列,初始化 PrintQueueIndexedProperty 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and array of PrintQueueIndexedProperty values to initialize.

PrintQueue(PrintServer, String, PrintQueueIndexedProperty[], PrintSystemDesiredAccess)

使用指定的 PrintQueue、佇列名稱、要初始化的 PrintServer 值陣列和想要的存取權限,初始化 PrintQueueIndexedProperty 類別的新執行個體。Initializes a new instance of PrintQueue class with the specified PrintServer, queue name, array of PrintQueueIndexedProperty values to initialize, and desired access.

PrintQueue(PrintServer, String, PrintSystemDesiredAccess)

使用指定的 PrintQueue、佇列名稱和想要的存取權限,初始化 PrintServer 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and desired access.

PrintQueue(PrintServer, String, String[])

使用指定的 PrintQueue、佇列名稱和要初始化的屬性名稱陣列,初始化 PrintServer 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, and array of property names to initialize.

PrintQueue(PrintServer, String, String[], PrintSystemDesiredAccess)

使用指定的 PrintQueue、佇列名稱、屬性篩選常式 (Filter) 和想要的存取權限,初始化 PrintServer 類別的新執行個體。Initializes a new instance of PrintQueue class using the specified PrintServer, queue name, property filter, and desired access.

屬性

AveragePagesPerMinute

取得以每分鐘頁數測量的印表機速度。Gets the speed of the printer measured in pages per minute.

ClientPrintSchemaVersion

取得列印結構描述的版本。Gets the version of the Print Schema.

Comment

取得或設定印表機的相關註解。Gets or sets a comment about the printer.

CurrentJobSettings

取得物件,這個物件包含目前列印工作的組態設定。Gets an object that contains the configuration settings for the current print job.

DefaultPrintTicket

取得或設定與這個 PrintQueue 關聯的預設印表機選項。Gets or sets the default printer options associated with this PrintQueue.

DefaultPriority

取得或設定提供給每個加入佇列之新列印工作的預設優先權。Gets or sets the default priority that is given to each new print job added to the queue.

Description

取得列印佇列的描述。Gets a description of the print queue.

FullName

取得佇列的完整名稱。Gets the complete name of the queue.

HasPaperProblem

取得值,這個值表示印表機是否有未指定的紙張問題。Gets a value that indicates if the printer is having an unspecified paper problem.

HasToner

取得值,這個值表示印表機是否有碳粉。Gets a value that indicates if the printer has toner.

HostingPrintServer

取得或設定可控制列印佇列之保護 (Protected) 的列印伺服器。Gets or sets (protected) the print server that controls the print queue.

InPartialTrust

取得或設定值,這個值表示佇列是在部分信任的模式這一較高信任層級中操作。Gets or sets a value that indicates whether the queue is operating in a partially trusted mode, a higher level of trust.

IsBidiEnabled

取得值,這個值表示是否啟用與印表機的雙向 (Bidirectional) 通訊。Gets a value that indicates whether bidirectional communication with the printer is enabled.

IsBusy

取得值,這個值表示列印裝置是否為忙碌中。Gets a value that indicates whether the printing device is busy.

IsDevQueryEnabled

取得值,這個值表示當文件與印表機組態不相符時佇列是否保留文件。Gets a value that indicates whether the queue holds documents when document and printer configurations do not match.

IsDirect

取得值,這個值表示佇列是直接列印至印表機,還是先多工緩衝處理文件再進行列印。Gets a value that indicates whether the queue prints directly to the printer or spools documents first and then prints them.

IsDisposed

取得或設定一個值,指出是否已經處置物件。Gets or sets a value that indicates whether the object has been disposed.

(繼承來源 PrintSystemObject)
IsDoorOpened

取得值,這個值表示是否印表機門未關。Gets a value that indicates whether a door is open on the printer.

IsHidden

取得值,這個值表示列印佇列在應用程式的使用者介面中是否隱藏。Gets a value that indicates whether the print queue is hidden in your application's user interface.

IsInError

取得值,這個值表示印表機或裝置是否發生錯誤狀況。Gets a value that indicates whether the printer or device is in an error condition.

IsInitializing

取得值,這個值表示印表機是否正在自行初始化。Gets a value that indicates whether the printer is initializing itself.

IsIOActive

取得值,這個值表示印表機是否正在接收或傳送資料或信號。Gets a value that indicates whether the printer is receiving or sending data or signals.

IsManualFeedRequired

取得值,這個值表示對於目前的列印工作,印表機是否需要手動送紙。Gets a value that indicates whether the printer needs to be manually fed paper for the current print job.

IsNotAvailable

取得值,這個值表示印表機是否可用。Gets a value that indicates whether the printer is available.

IsOffline

取得值,這個值指出印表機是否離線。Gets a value that indicates whether the printer is offline.

IsOutOfMemory

取得值,這個值表示印表機是否記憶體不足。Gets a value that indicates whether the printer is out of memory.

IsOutOfPaper

取得值,這個值表示印表機是否需要重新放入目前工作所需大小的紙張。Gets a value that indicates whether the printer needs to be reloaded with paper of the size required for the current job.

IsOutputBinFull

取得值,這個值表示印表機的輸出區域是否即將溢位。Gets a value that indicates whether the output area of the printer is in danger of overflowing.

IsPaperJammed

取得值,這個值表示目前這張紙是否夾在印表機中。Gets a value that indicates whether the current sheet of paper is stuck in the printer.

IsPaused

取得值,這個值表示列印佇列是否已暫停。Gets a value that indicates whether the print queue has been paused.

IsPendingDeletion

取得值,這個值表示印表機是否正在刪除列印工作。Gets a value that indicates whether the printer is in the process of deleting a print job.

IsPowerSaveOn

取得值,這個值表示印表機是否處於省電模式。Gets a value that indicates whether the printer is in power save mode.

IsPrinting

取得值,這個值表示是否正在列印工作。Gets a value that indicates whether a job is printing.

IsProcessing

取得值,這個值表示印表機是否正在處理列印工作。Gets a value that indicates whether the printer is processing a print job.

IsPublished

取得值,這個值表示其他網路使用者是否可看到該印表機。Gets a value that indicates whether the printer is visible to other network users.

IsQueued

取得值,這個值表示印表機是否可支援同時含有多個列印工作的佇列。Gets a value that indicates whether the printer can support a queue with more than one print job in it at a time.

IsRawOnlyEnabled

取得值,這個值表示列印佇列是否可以使用加強型中繼檔 (Enhanced Meta File,EMF),這種檔案能夠加快從列印應用程式到 Windows 多工緩衝處理程式的資料流程。Gets a value that indicates whether the print queue can use EMF (Enhanced Meta File) that enables faster data flow from a printing application to the Windows spooler.

IsServerUnknown

取得值,這個值表示印表機是否處於錯誤狀態。Gets a value that indicates whether the printer is in an error state.

IsShared

取得值,這個值表示網路上的其他電腦是否可以使用該印表機。Gets a value that indicates whether the printer is available for use by other computers on the network.

IsTonerLow

取得值,這個值表示印表機是否碳粉不足。Gets a value that indicates whether the printer is running short of toner.

IsWaiting

取得值,這個值表示佇列是否正等待加入工作。Gets a value that indicates whether the queue is waiting for a job to be added.

IsWarmingUp

取得值,這個值表示印表機是否在準備中。Gets a value that indicates whether the printer is warming up.

IsXpsDevice

取得值,其指出印表機的驅動程式是否建置在 XPSDrv 模型上,以使用 XML 文件規格 (XPS) 作為其分頁描述語言。Gets a value that indicates whether the printer's driver is built on the XPSDrv model so it uses XML Paper Specification (XPS) as its page description language.

KeepPrintedJobs

取得值,這個值表示佇列是否要在列印後儲存印表機語言檔案,而不是將其刪除。Gets a value that indicates whether the queue is saving the printer language file instead of deleting it following printing.

Location

取得或設定印表機的實體位置。Gets or sets the printer's physical location.

MaxPrintSchemaVersion

取得佇列可用的最新可能列印結構描述版本號碼。Gets the most recent possible version number of the Print Schema that the queue can use.

Name

取得或設定列印佇列的名稱。Gets or sets the print queue's name.

NeedUserIntervention

取得值,這個值表示印表機是否需要使用者互動。Gets a value that indicates whether the printer needs the attention of a human being.

NumberOfJobs

取得列印佇列中排列的工作總數。Gets the total number of jobs lined up in the print queue.

PagePunt

取得值,這個值表示是否印表機無法列印目前頁。Gets a value that indicates whether the printer is unable to print the current page.

Parent

取得物件的父物件。Gets the parent of the object.

(繼承來源 PrintSystemObject)
PrintingIsCancelled

取得值,這個值表示是否要取消目前的列印工作。Gets or sets a value that indicates whether the current print job is being cancelled.

Priority

取得或設定此列印佇列相對於其他列印佇列的優先權,其他列印佇列與此佇列裝載於同一列印伺服器上並使用相同的實體印表機。Gets or sets the priority of the print queue relative to other print queues that are hosted by the same print server and that use the same physical printer.

PropertiesCollection

取得屬性和值組的集合。Gets a collection of attribute and value pairs.

(繼承來源 PrintSystemObject)
QueueAttributes

取得列印佇列的屬性。Gets the properties of the print queue.

QueueDriver

取得或設定佇列的印表機驅動程式。Gets or sets the printer driver for the queue.

QueuePort

取得或設定佇列使用的通訊埠。Gets or sets the port that the queue uses.

QueuePrintProcessor

取得或設定佇列使用的列印處理器。Gets or sets the print processor that the queue uses.

QueueStatus

取得值,這個值表示印表機的狀態。Gets a value that represents the status of the printer. 狀態包括「準備中」、「正在初始化」、「正在列印」及其他狀態。These include "warming up," "initializing," "printing," and others.

ScheduleCompletedJobsFirst

取得值,這個值表示印表機是否先列印已完成多工緩衝處理程序的工作,再列印尚未完成多工緩衝處理的工作,即使後者先進入佇列或具有更高優先權也是如此。Gets a value that indicates whether the printer prints jobs that have completed the spooling process before jobs that have not fully spooled even if the latter entered the queue first or have a higher priority.

SeparatorFile

取得或設定要插入每個列印工作開頭之檔案的路徑和檔名。Gets or sets the path and file name of a file that is inserted at the beginning of each print job.

ShareName

取得或設定印表機名稱,在網路上共用該印表機時使用者會看到這個名稱。Gets or sets a name for the printer that is seen by users on the network when it is shared.

StartTimeOfDay

取得或設定一天中印表機開始列印工作的最早時間,以午夜 Coordinated Universal Time (UTC,亦稱為格林威治標準時間 (Greenwich Mean Time,GMT)) 之後經過的分鐘數表示。Gets or sets the earliest time of day, expressed as the number of minutes after midnight Coordinated Universal Time (UTC) (also called Greenwich Mean Time [GMT]), that the printer will print a job.

UntilTimeOfDay

取得或設定一天中印表機列印工作的最晚時間,以午夜 Coordinated Universal Time (UTC,亦稱為格林威治標準時間 (Greenwich Mean Time,GMT)) 之後經過的分鐘數表示。Gets or sets the latest time, expressed as the number of minutes after midnight Coordinated Universal Time (UTC) (also called Greenwich Mean Time [GMT]), that the printer will print a job.

UserPrintTicket

取得或設定目前使用者的預設 PrintTicket 物件,這個物件包含列印工作的詳細資訊。Gets or sets the current user's default PrintTicket object which contains detailed information about the print job.

方法

AddJob()

在佇列中插入新 (以一般方式命名) 的列印工作,其內容是 Byte 陣列。Inserts a new (generically named) print job, whose content is a Byte array, into the queue.

AddJob(String)

在佇列中插入新的列印工作,其內容是 Byte 陣列。Inserts a new print job, whose content is a Byte array, into the queue.

AddJob(String, PrintTicket)

XML 文件規格 (XPS)XML Paper Specification (XPS) 文件的新列印工作插入佇列,而且為其指定名稱和設定。Inserts a new print job for an XML 文件規格 (XPS)XML Paper Specification (XPS) Document into the queue, and gives it the specified name and settings.

AddJob(String, String, Boolean)

XML 文件規格 (XPS)XML Paper Specification (XPS) 文件的新列印工作插入佇列,為其指定名稱,並指定是否應驗證該工作。Inserts a new print job for an XML 文件規格 (XPS)XML Paper Specification (XPS) Document into the queue, gives it the specified name, and specifies whether or not it should be validated.

AddJob(String, String, Boolean, PrintTicket)

XML 文件規格 (XPS)XML Paper Specification (XPS) 文件的新列印工作插入佇列,為其指定名稱和設定,並指定是否應驗證該工作。Inserts a new print job for an XML 文件規格 (XPS)XML Paper Specification (XPS) Document into the queue, gives it the specified name and settings, and specifies whether or not it should be validated.

Commit()

PrintQueue 物件的目前屬性寫入至列印伺服器上的實際列印佇列。Writes the current properties of the PrintQueue object to the actual print queue on the print server.

CreateXpsDocumentWriter(Double, Double)

使用指定的維度 (Dimension) 建立 XpsDocumentWriter 物件。Creates an XpsDocumentWriter object with the specified dimensions.

CreateXpsDocumentWriter(PrintDocumentImageableArea)

建立 XpsDocumentWriter 物件,開啟 Windows 通用列印對話方塊,並傳回 ref (Visual Basic 中為 ByRef) 參數,這個參數表示可影像化區域和媒體維度的詳細資訊。Creates an XpsDocumentWriter object, opens a Windows common print dialog and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

CreateXpsDocumentWriter(PrintDocumentImageableArea, PageRangeSelection, PageRange)

建立 XpsDocumentWriter 物件,開啟 Windows 通用列印對話方塊,在對話方塊中輸入頁面範圍和列印工作的描述,並傳回 ref (Visual Basic 中為 ByRef) 參數,這個參數表示可影像化區域和媒體維度的詳細資訊。Creates an XpsDocumentWriter object, opens a Windows common print dialog, provides the dialog with a page range and a description of the print job, and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

CreateXpsDocumentWriter(PrintQueue)

建立 XpsDocumentWriter 物件,並將它與指定的列印佇列相關聯。Creates an XpsDocumentWriter object and associates it with the specified print queue.

CreateXpsDocumentWriter(String, PrintDocumentImageableArea)

建立 XpsDocumentWriter 物件,開啟 Windows 通用列印對話方塊 (並為其提供工作描述),且傳回 ref (Visual Basic 中為ByRef) 參數,這個參數表示可影像化區域和媒體維度的詳細資訊。Creates an XpsDocumentWriter object, opens a Windows common print dialog (and provides it a job description) and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

CreateXpsDocumentWriter(String, PrintDocumentImageableArea, PageRangeSelection, PageRange)

建立 XpsDocumentWriter 物件,開啟 Windows 通用列印對話方塊,在對話方塊中輸入頁面範圍,並傳回 ref (Visual Basic 中為 ByRef) 參數,這個參數表示可影像化區域和媒體維度的詳細資訊。Creates an XpsDocumentWriter object, opens a Windows common print dialog, provides the dialog with a page range, and returns a ref (ByRef in Visual Basic) parameter that represents information about the imageable area and the dimensions of the media.

Dispose()

釋放 PrintSystemObject 所使用的所有資源。Releases all resources used by the PrintSystemObject.

(繼承來源 PrintSystemObject)
Dispose(Boolean)

釋放 PrintSystemObject 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the PrintSystemObject and optionally releases the managed resources.

(繼承來源 PrintSystemObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetJob(Int32)

取得具有指定 ID 編號的列印工作。Gets the print job with the specified ID number.

GetPrintCapabilities()

取得 PrintCapabilities 物件,這個物件會識別印表機功能。Gets a PrintCapabilities object that identifies the capabilities of the printer.

GetPrintCapabilities(PrintTicket)

取得 PrintCapabilities 物件,這個物件會識別印表機功能。Gets a PrintCapabilities object that identifies the capabilities of the printer.

GetPrintCapabilitiesAsXml()

取得 MemoryStream 物件,其會以符合列印結構描述的 XML 資料流形式指定印表機的功能。Gets a MemoryStream object that specifies the printer's capabilities as an XML stream that complies with the Print Schema.

GetPrintCapabilitiesAsXml(PrintTicket)

取得 MemoryStream 物件,其會以符合列印結構描述的 XML 格式來指定印表機的功能。Gets a MemoryStream object that specifies the printer's capabilities in an XML format that complies with the Print Schema.

GetPrintJobInfoCollection()

針對佇列中的每個工作建立包含 PrintSystemJobInfo 物件的集合。Creates a collection that contains a PrintSystemJobInfo object for each job in the queue.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
Initialize()

初始化 PrintSystemObject 的屬性。Initializes the properties of the PrintSystemObject.

(繼承來源 PrintSystemObject)
InternalDispose(Boolean)

釋放 PrintQueue 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the PrintQueue and optionally releases the managed resources.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
MergeAndValidatePrintTicket(PrintTicket, PrintTicket)

會合併兩個 PrintTicket 並保證得出有效的 PrintTicket,且不會要求印表機不支援的任何列印功能。Merges two PrintTickets and guarantees that the resulting PrintTicket is valid and does not ask for any printing functionality that the printer does not support.

MergeAndValidatePrintTicket(PrintTicket, PrintTicket, PrintTicketScope)

合併兩個 PrintTicket 並保證得出有效的 PrintTicket,且不會要求印表機不支援的任何列印功能,並限制在指定的範圍內。Merges two PrintTickets and guarantees that the resulting PrintTicket is valid, does not ask for any printing functionality that the printer does not support, and is limited to the specified scope.

Pause()

暫停列印佇列。Pauses the print queue. 它會保持暫停,直到執行 Resume()It remains paused until Resume() is executed.

Purge()

移除列印佇列中的所有工作。Removes all the jobs in the print queue.

Refresh()

使用電腦上執行之印表機和列印佇列公用程式的值,更新 PrintQueue 的屬性。Updates the properties of the PrintQueue object with values from the printer and the print queue utility that runs on the computer.

Resume()

重新啟動已暫停的列印佇列。Restarts a print queue that was paused.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱