Important: |
---|
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. |
A version of this page is also available for
4/8/2010
To open a queue, the application must specify the access mode and share mode of the queue when it calls MSMQQueueInfo.Open.
The Openmethod returns an MSMQQueueobject that can be used for the following:
- Sending messages to the queue (
MSMQMessage.Send).
- Reading messages in the queue (
MSMQQueue.Peek,
MSMQQueue.PeekNext,
MSMQQueue.Receive).
- Enabling notification for reading messages asynchronously (
MSMQQueue.EnableNotification).
- Closing the queue (
MSMQQueue.Close).
Note: The MSMQQueueobject exposes a queue handle that can be used to call Message Queuing functions directly.
When a queue is opened, its properties are based on the properties of the MSMQQueueInfoobject when the queue was opened. Later, while the queue is opened, the application can see the properties of the queue by calling the MSMQQueueobject's QueueInfoproperty.
The following examples show several ways to open queues.
For examples on | See |
---|---|
Opening a queue to send messages |
|
Opening a queue to peek at or retrieve messages |