Csharp/C Sharp by API/System.Messaging/Message
Версия от 15:31, 26 мая 2010; (обсуждение)
Message.Body
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 );
}
}
}