Cursor Cursor Cursor Cursor Class

定義

讀取佇列的訊息時,會使用 Cursor 保持 MessageQueue 中的特定位置。A Cursor is used to maintain a specific location in a MessageQueue when reading the queue's messages.

public ref class Cursor sealed : IDisposable
public sealed class Cursor : IDisposable
type Cursor = class
    interface IDisposable
Public NotInheritable Class Cursor
Implements IDisposable
繼承
CursorCursorCursorCursor
實作

備註

若要取得的資料指標MessageQueue,呼叫CreateCursor該佇列的方法。To get a cursor for a MessageQueue, call the CreateCursor method for that queue.

ACursor等方法一起使用Peek(TimeSpan, Cursor, PeekAction)Receive(TimeSpan, Cursor)當您需要讀取不在佇列前端的訊息。A Cursor is used with such methods as Peek(TimeSpan, Cursor, PeekAction) and Receive(TimeSpan, Cursor) when you need to read messages that are not at the front of the queue. 這包括同步或非同步讀取訊息。This includes reading messages synchronously or asynchronously. 資料指標不需要用來讀取的第一個訊息佇列中。Cursors do not need to be used to read only the first message in a queue.

閱讀在交易內的郵件時,訊息佇列不會回復資料指標移動如果交易已中止。When reading messages within a transaction, Message Queuing does not roll back cursor movement if the transaction is aborted. 例如,假設有兩個訊息,A1 和 A2 的佇列。For example, suppose there is a queue with two messages, A1 and A2. 如果您移除訊息在交易中的 A1 時,訊息佇列將游標移至訊息 A2。If you remove message A1 while in a transaction, Message Queuing moves the cursor to message A2. 不過,如果因為任何原因將會中止交易,A1 插回佇列,但資料指標的訊息會保留指向 A2 訊息。However, if the transaction is aborted for any reason, message A1 is inserted back into the queue but the cursor remains pointing at message A2.

若要關閉資料指標,呼叫CloseTo close the cursor, call Close.

方法

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

關閉游標,讓 Message Queuing 釋放相關聯的資源。Closes the cursor, allowing Message Queuing to release the associated resources.

Dispose() Dispose() Dispose() Dispose()

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

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()
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

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

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

適用於

另請參閱