MessagePropertyFilter.TransactionId 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 TransactionId informasi properti saat menerima atau mengintip pesan.
public:
property bool TransactionId { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgTransactionId")]
public bool TransactionId { get; set; }
[<System.Messaging.MessagingDescription("MsgTransactionId")>]
member this.TransactionId : bool with get, set
Public Property TransactionId As Boolean
Nilai Properti
true
untuk menerima TransactionId informasi; jika tidak, false
. Default adalah false
.
- Atribut
Contoh
Contoh kode berikut menunjukkan penggunaan TransactionId properti .
// Set the queue's MessageReadPropertyFilter property
// to enable the message's TransactionId property.
queue->MessageReadPropertyFilter->TransactionId = 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
// TransactionId property.
Console::WriteLine("Message.TransactionId: {0}",
orderMessage->TransactionId);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's TransactionId property.
queue.MessageReadPropertyFilter.TransactionId = 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 TransactionId property.
Console.WriteLine("Message.TransactionId: {0}",
orderMessage.TransactionId);
Keterangan
Properti TransactionIdMessage kelas mengidentifikasi transaksi yang mengirim pesan. Gunakan properti ini dalam aplikasi penerima untuk memverifikasi bahwa pesan dikirim sebagai bagian dari transaksi tertentu.