Receive message : MessageQueue : Windows C# Examples


C# Examples » Windows » MessageQueue »

 

Receive message









    
using  System;
using  System.Messaging;

class  MainClass
{
    [STAThread]
    static  void  Main(string[]  args)
    {
        MessageQueue  txq2  =  new  MessageQueue(  @".\Private$\txq2"  );

        while  (  true  )
        {
            Message  msgIn  =  txq2.Receive(  MessageQueueTransactionType.Single  );
            msgIn.Formatter  =  new  XmlMessageFormatter(  new  String[]  {  "System.String,  mscorlib",  }  );
            System.Console.WriteLine(  "Received:  {0}",  (string)msgIn.Body  );
        }
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Windows
» MessageQueue