MessagePropertyFilter.TransactionId Egenskap

Definition

Hämtar eller anger ett värde som anger om du vill hämta TransactionId egenskapsinformation när du tar emot eller granskar ett meddelande.

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

Egenskapsvärde

true för att ta emot TransactionId information, falseannars . Standardvärdet är false.

Attribut

Exempel

Följande kodexempel visar hur egenskapen används 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);
// 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);

Kommentarer

Egenskapen TransactionId för Message klassen identifierar transaktionen som skickade meddelandet. Använd den här egenskapen i ett mottagande program för att verifiera att ett meddelande har skickats som en del av en specifik transaktion.

Gäller för

Se även