PrintQueueStream PrintQueueStream PrintQueueStream PrintQueueStream Class

定義

資料流,表示列印佇列中的多工緩衝處理列印工作。A stream that represents a spooled print job in a print queue.

public ref class PrintQueueStream : System::IO::Stream
public class PrintQueueStream : System.IO.Stream
type PrintQueueStream = class
    inherit Stream
Public Class PrintQueueStream
Inherits Stream
繼承

備註

使用這個類別來寫入多工緩衝處理檔案,不會自動包含的裝置特定資訊Microsoft WindowsMicrosoft Windows多工緩衝處理器。Use this class to write device specific information to a spool file that is not automatically included by the Microsoft WindowsMicrosoft Windows spooler. 當然,您必須知道多工緩衝處理檔案是否加強型中繼檔 (EMF)Enhanced Metafile (EMF)XML 文件規格 (XPS)XML Paper Specification (XPS)Of course, you need to know whether the spool file is 加強型中繼檔 (EMF)Enhanced Metafile (EMF) or XML 文件規格 (XPS)XML Paper Specification (XPS). 如果您偏好使用Byte陣列中,您也可以使用兩個多載AddJob方法和JobStream寫入多工緩衝處理檔案的屬性。If you prefer working with a Byte array, you can also use two of the overloads of the AddJob method and the JobStream property to write to the spool file.

警告

類別內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 Form 應用程式,請參閱System.Drawing.Printing命名空間。If you want to print from a Windows Forms application, see the System.Drawing.Printing namespace.

建構函式

PrintQueueStream(PrintQueue, String) PrintQueueStream(PrintQueue, String) PrintQueueStream(PrintQueue, String) PrintQueueStream(PrintQueue, String)

初始化的新執行個體PrintQueueStream類別的指定列印工作裝載在指定PrintQueueInitializes a new instance of the PrintQueueStream class for the specified print job that is hosted in the specified PrintQueue.

PrintQueueStream(PrintQueue, String, Boolean) PrintQueueStream(PrintQueue, String, Boolean) PrintQueueStream(PrintQueue, String, Boolean) PrintQueueStream(PrintQueue, String, Boolean)

初始化的新執行個體PrintQueueStream類別的指定列印工作裝載中指定PrintQueue,指出是否使用中的資料PrintQueueStream進行認可時關閉資料流。Initializes a new instance of the PrintQueueStream class for the specified print job that is hosted in the specified PrintQueue, with an indication of whether data in the PrintQueueStream should be committed when the stream is closed.

PrintQueueStream(PrintQueue, String, Boolean, PrintTicket) PrintQueueStream(PrintQueue, String, Boolean, PrintTicket) PrintQueueStream(PrintQueue, String, Boolean, PrintTicket) PrintQueueStream(PrintQueue, String, Boolean, PrintTicket)

初始化的新執行個體PrintQueueStream類別的指定列印工作裝載中指定PrintQueue,指出是否與指定的設定中的資料PrintQueueStream進行認可時關閉資料流。Initializes a new instance of the PrintQueueStream class for the specified print job that is hosted in the specified PrintQueue, with the specified settings and an indication of whether data in the PrintQueueStream should be committed when the stream is closed.

屬性

CanRead CanRead CanRead CanRead

取得值,這個值表示資料流是否支援讀取。Gets a value that indicates whether the stream supports reading.

CanSeek CanSeek CanSeek CanSeek

取得指出資料流是否支援搜尋的值,這會將讀取/寫入位置移到資料流中的新位置。Gets a value that indicates whether the stream supports seeking, which is moving the read/write position to a new position in the stream.

CanTimeout CanTimeout CanTimeout CanTimeout

取得值,該值判斷目前的資料流是否可以逾時。Gets a value that determines whether the current stream can time out.

(Inherited from Stream)
CanWrite CanWrite CanWrite CanWrite

取得值,這個值表示資料流是否支援寫入。Gets a value that indicates whether the stream supports writing.

JobIdentifier JobIdentifier JobIdentifier JobIdentifier

取得列印工作的 ID 編號。Gets the ID number of the print job.

Length Length Length Length

取得資料流的長度,以位元組為單位。Gets the length of the stream in bytes.

Position Position Position Position

取得或設定資料流中目前的讀取/寫入位置。Gets or sets the current read/write position in the stream.

ReadTimeout ReadTimeout ReadTimeout ReadTimeout

取得或設定值 (以毫秒為單位),這個值決定在逾時前資料流將嘗試讀取多長時間。Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.

(Inherited from Stream)
WriteTimeout WriteTimeout WriteTimeout WriteTimeout

取得或設定值 (以毫秒為單位),這個值決定在逾時前資料流將嘗試寫入多長時間。Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.

(Inherited from Stream)

方法

BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

開始非同步的讀取作業。Begins an asynchronous read operation. (請考慮用 ReadAsync(Byte[], Int32, Int32) 替代。)(Consider using ReadAsync(Byte[], Int32, Int32) instead.)

(Inherited from Stream)
BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)

開始非同步的寫入作業。Begins an asynchronous write operation.

Close() Close() Close() Close()

關閉資料流並釋出與此資料流相關聯的任何資源,例如通訊端和檔案控制代碼。Closes the stream and releases any resources, such as sockets and file handles, that are associated with it.

CopyTo(Stream) CopyTo(Stream) CopyTo(Stream) CopyTo(Stream)

從目前資料流讀取位元組,並將其寫入另一個資料流中。Reads the bytes from the current stream and writes them to another stream.

(Inherited from Stream)
CopyTo(Stream, Int32) CopyTo(Stream, Int32) CopyTo(Stream, Int32) CopyTo(Stream, Int32)

使用指定的緩衝區大小,從目前資料流讀取所有位元組,並將其寫入另一個資料流中。Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.

(Inherited from Stream)
CopyToAsync(Stream) CopyToAsync(Stream) CopyToAsync(Stream) CopyToAsync(Stream)

以非同步的方式從目前資料流讀取所有位元組,並將其寫入另一個資料流中。Asynchronously reads the bytes from the current stream and writes them to another stream.

(Inherited from Stream)
CopyToAsync(Stream, CancellationToken) CopyToAsync(Stream, CancellationToken) CopyToAsync(Stream, CancellationToken) CopyToAsync(Stream, CancellationToken)

使用指定的取消權杖,以非同步的方式從目前資料流讀取位元組,並將其寫入另一個資料流。Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified cancellation token.

(Inherited from Stream)
CopyToAsync(Stream, Int32) CopyToAsync(Stream, Int32) CopyToAsync(Stream, Int32) CopyToAsync(Stream, Int32)

使用指定的緩衝區大小,以非同步的方式從目前資料流讀取所有位元組,並將其寫入另一個資料流中。Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size.

(Inherited from Stream)
CopyToAsync(Stream, Int32, CancellationToken) CopyToAsync(Stream, Int32, CancellationToken) CopyToAsync(Stream, Int32, CancellationToken) CopyToAsync(Stream, Int32, CancellationToken)

使用指定的緩衝區大小和取消語彙基元,以非同步的方式從目前資料流讀取位元組,並將其寫入另一個資料流。Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.

(Inherited from Stream)
CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
CreateWaitHandle() CreateWaitHandle() CreateWaitHandle() CreateWaitHandle()

配置 WaitHandle 物件。Allocates a WaitHandle object.

(Inherited from Stream)
Dispose() Dispose() Dispose() Dispose()

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

(Inherited from Stream)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

DisposeAsync() DisposeAsync() DisposeAsync() DisposeAsync()

以非同步方式釋放 Stream 使用的不受控資源。Asynchronously releases the unmanaged resources used by the Stream.

(Inherited from Stream)
EndRead(IAsyncResult) EndRead(IAsyncResult) EndRead(IAsyncResult) EndRead(IAsyncResult)

等候暫止的非同步讀取完成。Waits for the pending asynchronous read to complete. (請考慮用 ReadAsync(Byte[], Int32, Int32) 替代。)(Consider using ReadAsync(Byte[], Int32, Int32) instead.)

(Inherited from Stream)
EndWrite(IAsyncResult) EndWrite(IAsyncResult) EndWrite(IAsyncResult) EndWrite(IAsyncResult)

結束非同步的寫入作業。Ends an asynchronous write operation.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

可讓PrintQueueStream嘗試釋放資源並執行其他清除作業後的PrintQueueStream記憶體回收 (gc) 回收。Enables a PrintQueueStream to attempt to free resources and perform other cleanup operations before the PrintQueueStream is reclaimed by garbage collection.

Flush() Flush() Flush() Flush()

清除這個資料流的所有緩衝區,並將任何緩衝資料寫入基礎裝置。Clears all the buffers for this stream and writes any buffered data to the underlying device.

FlushAsync() FlushAsync() FlushAsync() FlushAsync()

以非同步的方式清除這個資料流的所有緩衝區,並造成所有緩衝資料都寫入基礎裝置。Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.

(Inherited from Stream)
FlushAsync(CancellationToken) FlushAsync(CancellationToken) FlushAsync(CancellationToken) FlushAsync(CancellationToken)

以非同步的方式清除這個資料流的所有緩衝區,造成所有緩衝資料都寫入基礎裝置,並且監視取消要求。Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

(Inherited from Stream)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
HandlePackagingProgressEvent(Object, PackagingProgressEventArgs) HandlePackagingProgressEvent(Object, PackagingProgressEventArgs) HandlePackagingProgressEvent(Object, PackagingProgressEventArgs) HandlePackagingProgressEvent(Object, PackagingProgressEventArgs)

可讓PrintQueueStream回應封裝程序,藉由處理PackagingProgressEventEnables the PrintQueueStream to respond to the packaging progress by handling the PackagingProgressEvent.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ObjectInvariant() ObjectInvariant() ObjectInvariant() ObjectInvariant()

提供 Contract 的支援。Provides support for a Contract.

(Inherited from Stream)
Read(Byte[], Int32, Int32) Read(Byte[], Int32, Int32) Read(Byte[], Int32, Int32) Read(Byte[], Int32, Int32)

從該資料流讀取位元組序列,並依讀取的位元組數將資料流中的讀取/寫入位置往前移。Reads a sequence of bytes from the stream and advances the read/write position in the stream by the number of bytes that were read.

Read(Span<Byte>) Read(Span<Byte>) Read(Span<Byte>) Read(Span<Byte>)

當在衍生類別中覆寫時,自目前資料流讀取一連串的位元組,並依所讀取的位元組數目進階資料流中的位置。When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

(Inherited from Stream)
ReadAsync(Byte[], Int32, Int32) ReadAsync(Byte[], Int32, Int32) ReadAsync(Byte[], Int32, Int32) ReadAsync(Byte[], Int32, Int32)

以非同步的方式從目前的資料流讀取位元組序列,並依讀取的位元組數將資料流中的位置往前移。Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

(Inherited from Stream)
ReadAsync(Byte[], Int32, Int32, CancellationToken) ReadAsync(Byte[], Int32, Int32, CancellationToken) ReadAsync(Byte[], Int32, Int32, CancellationToken) ReadAsync(Byte[], Int32, Int32, CancellationToken)

以非同步的方式從目前資料流讀取一連串的位元組、依所讀取的位元組數目進階資料流中的位置,以及監視取消要求。Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

(Inherited from Stream)
ReadAsync(Memory<Byte>, CancellationToken) ReadAsync(Memory<Byte>, CancellationToken) ReadAsync(Memory<Byte>, CancellationToken) ReadAsync(Memory<Byte>, CancellationToken)

以非同步的方式從目前資料流讀取一連串的位元組、依所讀取的位元組數目進階資料流中的位置,以及監視取消要求。Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

(Inherited from Stream)
ReadByte() ReadByte() ReadByte() ReadByte()

從資料流讀取一個位元組,並將資料流的位置推進一個位元組;如果在資料流末端,則傳回 -1。Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

(Inherited from Stream)
Seek(Int64, SeekOrigin) Seek(Int64, SeekOrigin) Seek(Int64, SeekOrigin) Seek(Int64, SeekOrigin)

設定資料流中的讀取/寫入位置。Sets the read/write position within the stream.

SetLength(Int64) SetLength(Int64) SetLength(Int64) SetLength(Int64)

設定資料流的長度。Sets the length of the stream.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)
Write(Byte[], Int32, Int32) Write(Byte[], Int32, Int32) Write(Byte[], Int32, Int32) Write(Byte[], Int32, Int32)

將位元組序列寫入資料流,並依寫入的位元組數將資料流中的讀取/寫入位置往前移。Writes a sequence of bytes to the stream and advances the read/write position in the stream by the number of bytes that are written.

Write(ReadOnlySpan<Byte>) Write(ReadOnlySpan<Byte>) Write(ReadOnlySpan<Byte>) Write(ReadOnlySpan<Byte>)

在衍生類別中覆寫時,將一連串的位元組寫入目前的資料流,並且由這個資料流中目前的位置前移寫入的位元組數目。When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

(Inherited from Stream)
WriteAsync(Byte[], Int32, Int32) WriteAsync(Byte[], Int32, Int32) WriteAsync(Byte[], Int32, Int32) WriteAsync(Byte[], Int32, Int32)

以非同步的方式將位元組序列寫入至目前的資料流,並依寫入的位元組數將資料流中目前的位置往前移。Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

(Inherited from Stream)
WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken) WriteAsync(Byte[], Int32, Int32, CancellationToken)

以非同步的方式將一連串的位元組寫入目前的資料流,由這個資料流中目前的位置前移寫入的位元組數目,並且監視取消要求。Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.

(Inherited from Stream)
WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

以非同步的方式將一連串的位元組寫入目前的資料流,由這個資料流中目前的位置前移寫入的位元組數目,並且監視取消要求。Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.

(Inherited from Stream)
WriteByte(Byte) WriteByte(Byte) WriteByte(Byte) WriteByte(Byte)

寫入一個位元組至資料流的目前位置,並將資料流位置推進一個位元組。Writes a byte to the current position in the stream and advances the position within the stream by one byte.

(Inherited from Stream)

明確介面實作

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

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

(Inherited from Stream)

適用於