MessagePropertyFilter.Body Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy pobierać Body informacje o właściwości podczas odbierania lub przeglądania komunikatu.

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

Wartość właściwości

true w celu otrzymywania Body informacji; falsew przeciwnym razie . Wartość domyślna to true.

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano użycie Body właściwości .

// 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);

Uwagi

Właściwość BodyMessage klasy reprezentuje serializowaną zawartość komunikatu. Treść może zawierać maksymalnie 4 MB danych.

Dotyczy

Zobacz też