question about MessageQueue
Hi, friends:
I try to send a message into MSMQ and then read it out.
But I find the message is not be removed after being accessed.
How can I read and remove it ?
Thanks
Charles Shao
================================================== ==============
myNewPrivateQueue1.Send("My message data.",
MessageQueueTransactionType.Single);
MessageEnumerator myEnumerator =
myNewPrivateQueue1.GetMessageEnumerator();
// Specify that the messages's priority should be read.
myNewPrivateQueue1.MessageReadPropertyFilter.Prior ity = true;
// Move to the next message and examine its priority.
while(myEnumerator.MoveNext())
{
// Increase the count if priority is Lowest.
if(myEnumerator.Current.Priority ==
MessagePriority.Lowest)
Console.WriteLine("Received MSG: " +
myEnumerator.Current.Body.ToString());
}