MessagePropertyFilter.Body Свойство

Определение

Получает или задает значение, указывающее, следует ли извлекать сведения свойства Body при получении или считывании сообщения.

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

Значение свойства

Значение true означает получение сведений Body, в противном случае — значение false. Значение по умолчанию — true.

Атрибуты

Примеры

В следующем примере кода демонстрируется использование 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);
// 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);

Комментарии

Свойство BodyMessage класса представляет сериализованное содержимое сообщения. Текст может содержать до 4 МБ данных.

Применяется к

См. также раздел