Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a few different ways you can do the above. I would recommend setting up an event on the message queue so that you are notified when a message is available rather than polling for it.</p> <p>Simple example of using message queues is <a href="http://www.codeproject.com/KB/cs/mgpmyqueue.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/mgpmyqueue.aspx</a> and the MSDN documentation for attaching events etc can be found at <a href="http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue_events.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue_events.aspx</a></p> <p>Microsoft example from <a href="http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.receivecompleted.aspx" rel="nofollow noreferrer">here</a>:</p> <pre><code> .... // Create an instance of MessageQueue. Set its formatter. MessageQueue myQueue = new MessageQueue(".\\myQueue"); myQueue.Formatter = new XmlMessageFormatter(new Type[] {typeof(String)}); // Add an event handler for the ReceiveCompleted event. myQueue.ReceiveCompleted += new ReceiveCompletedEventHandler(MyReceiveCompleted); // Begin the asynchronous receive operation. myQueue.BeginReceive(); .... private static void MyReceiveCompleted(Object source, ReceiveCompletedEventArgs asyncResult) { // Connect to the queue. MessageQueue mq = (MessageQueue)source; // End the asynchronous Receive operation. Message m = mq.EndReceive(asyncResult.AsyncResult); // Display message information on the screen. Console.WriteLine("Message: " + (string)m.Body); // Restart the asynchronous Receive operation. mq.BeginReceive(); return; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload