Bagikan melalui


MessagePropertyFilter.Body Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah akan mengambil Body informasi properti saat menerima atau mengintip pesan.

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

Nilai Properti

true untuk menerima Body informasi; jika tidak, false. Default adalah true.

Atribut

Contoh

Contoh kode berikut menunjukkan penggunaan Body properti .

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

Keterangan

Properti Body kelas Message mewakili konten pesan yang diserialisasikan. Isi dapat berisi hingga 4 MB data.

Berlaku untuk

Lihat juga