Results 1 to 2 of 2

Thread: System.Messaging

  1. #1
    Join Date
    Dec 1969

    Default System.Messaging

    I am trying to learn Messaging by doing a small console app first. It builds and runs without error. However, I do not see the message it sent to the private queue. Any ideas? Here&#039;s the code:<BR><BR>[code language="C#"]<BR> class Class1<BR> {<BR> /// &#060;summary&#062;<BR> /// The main entry point for the application.<BR> /// &#060;/summary&#062;<BR> [STAThread]<BR> static void Main(string[] args)<BR> {<BR> Console.WriteLine("

    Retrieving Private Queues...");<BR> try<BR> {<BR> MessageQueue[] queues = MessageQueue.GetPrivateQueuesByMachine("christop-fjc5ft");<BR> foreach(MessageQueue queue in queues)<BR> Console.WriteLine(" " + queue.QueueName);<BR><BR> if(MessageQueue.Exists(@".private$WroxTest"))<BR> {<BR> Console.WriteLine("
    Found WroxTest Private Queue; Ready to process...
    ");<BR> MessageQueue qWrox = new MessageQueue(@".private$wroxtest");<BR> Console.WriteLine(" LABEL: " + qWrox.Label);<BR> Console.WriteLine(" Sending Message to " + qWrox.QueueName);<BR> qWrox.Send("First Transmission", "Test Message");<BR> Console.WriteLine(" Message sent; terminating...");<BR> qWrox.Dispose();<BR> }<BR> }<BR> catch(MessageQueueException mqex)<BR> {<BR> Console.WriteLine("Message Queue Error Information...");<BR> Console.WriteLine(mqex.Message);<BR> }<BR> catch(Exception ex)<BR> {<BR> Console.WriteLine("Error Information...");<BR> Console.WriteLine(ex.Message);<BR> }<BR> finally<BR> {<BR> Console.WriteLine("
    Press any key to terminate");<BR> Console.Read(); <BR> }<BR> }<BR> }<BR><BR>[/code]

  2. #2
    Join Date
    Dec 1969

    Default RE: System.Messaging

    Ummm... it just started working. I haven&#039;t really changed anything. Go figure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts