C# (C Sharp) - How to receive message from a Microsoft message queue?
The sample code below shows how to connect to a message queue and receive a message System.Messaging.MessageQueue queue = new System.Messaging.MessageQueue(".\Private$\MyPrivateQueue"); queue.Send("Sample message"); System.Messaging.Message msg = queue.Receive(); msg.Formatter = new System.Messaging.XmlMessageFormatter( new string[] {"System.String"}); Console.WriteLine(msg.Body);
Category: | C# (C Sharp) |
<< Go back