Freigeben über


MessagePropertyFilter.Body Eigenschaft

Definition

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob Eigenschaftsinformationen beim Empfangen oder Anzeigen einer Nachricht abgerufen Body werden sollen.

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

Eigenschaftswert

true informationen zu erhalten Body ; falseandernfalls . Der Standardwert lautet true.

Attribute

Beispiele

Im folgenden Codebeispiel wird die Verwendung der Body Eigenschaft veranschaulicht.

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

Hinweise

Die Body Eigenschaft der Message Klasse stellt den serialisierten Inhalt der Nachricht dar. Der Textkörper kann bis zu 4 MB Daten enthalten.

Gilt für:

Weitere Informationen