|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
This filter retrieves all message with a specific message class from a known administration queue.
This filter removes messages from the queue. When a message with the desired class is found, MSMQQueue.ReceiveCurrentis called to remove the message and MSMQQueue.PeekCurrentis called to look at the next message. When a message is removed from the queue, the cursor is automatically moved to the next message in the queue.
|If you do not want to remove messages from the queue, use MSMQQueue.PeekCurrentto look at the current message, and use MSMQQueue.PeekNextto move the cursor and look at the next message.|
Declare the MSMQQueueInfo, MSMQQueue, and MSMQMessageobject needed to create the filter.
Call MSMQQueueInfo.Opento open the queue with receive access.
Receive access allows you to peek at and retrieve messages.
Call MSMQQueue.PeekCurrentto peek at the first message in the queue.
Before using the cursor to navigate through the queue, you must point the cursor to the first message in the queue.
Filter out the messages in the queue.
MSMQQueue.ReceiveCurrentand MSMQQueue.PeekCurrentare used if the message is removed.
MSMQQueue.PeekNextis used if the message is does not fit the search criteria.
Call Closeto close the queue.