MessagePropertyFilter.MessageType Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau menetapkan nilai yang menunjukkan apakah akan mengambil MessageType informasi properti saat menerima atau mengintip pesan.
public:
property bool MessageType { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgMessageType")]
public bool MessageType { get; set; }
[<System.Messaging.MessagingDescription("MsgMessageType")>]
member this.MessageType : bool with get, set
Public Property MessageType As Boolean
Nilai Properti
true
untuk menerima MessageType informasi; jika tidak, false
. Default adalah true
.
- Atribut
Contoh
Contoh kode berikut menunjukkan penggunaan MessageType properti .
// Set the queue's MessageReadPropertyFilter property
// to enable the message's MessageType property.
queue->MessageReadPropertyFilter->MessageType = 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
// MessageType property.
Console::WriteLine("Message.MessageType: {0}",
orderMessage->MessageType);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's MessageType property.
queue.MessageReadPropertyFilter.MessageType = 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 MessageType property.
Console.WriteLine("Message.MessageType: {0}",
orderMessage.MessageType);
Keterangan
Properti MessageType kelas Message mengidentifikasi jenis pesan. Pesan dapat berupa pesan normal, pesan pengakuan positif atau negatif, atau pesan laporan.