MessagePropertyFilter.Body Vlastnost

Definice

Získá nebo nastaví hodnotu, která určuje, zda se mají načíst Body informace o vlastnosti při příjmu nebo náhledu zprávy.

public:
 property bool Body { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgBody")]
public bool Body { get; set; }
[<System.Messaging.MessagingDescription("MsgBody")>]
member this.Body : bool with get, set
Public Property Body As Boolean

Hodnota vlastnosti

truepro příjem Body informací, jinak . false Výchozí formát je true.

Atributy

Příklady

Následující příklad kódu ukazuje použití Body vlastnosti .

// Set the queue's MessageReadPropertyFilter property 
// to enable the message's Body property.
queue->MessageReadPropertyFilter->Body = true;

// Peek at the message. Time out after ten seconds 
// in case the message was not delivered.
orderMessage = queue->Peek(TimeSpan::FromSeconds(10.0));

// Display the value of the message's Body property.
Console::WriteLine("Message.Body: {0}", 
    orderMessage->Body);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's Body property.
queue.MessageReadPropertyFilter.Body = true;

// Peek at the message. Time out after ten seconds in case the message
// was not delivered.
orderMessage = queue.Peek(TimeSpan.FromSeconds(10.0));

// Display the value of the message's Body property.
Console.WriteLine("Message.Body: {0}", orderMessage.Body);

Poznámky

Vlastnost BodyMessage třídy představuje serializovaný obsah zprávy. Tělo může obsahovat až 4 MB dat.

Platí pro

Viz také