MessagePropertyFilter.SenderId Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy pobierać SenderId informacje o właściwości podczas odbierania lub przeglądania komunikatu.

public:
 property bool SenderId { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgSenderId")]
public bool SenderId { get; set; }
[<System.Messaging.MessagingDescription("MsgSenderId")>]
member this.SenderId : bool with get, set
Public Property SenderId As Boolean

Wartość właściwości

true w celu otrzymywania SenderId informacji; falsew przeciwnym razie . Wartość domyślna to false.

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano użycie SenderId właściwości .

// Set the queue's MessageReadPropertyFilter property 
// to enable the message's SenderId property.
queue->MessageReadPropertyFilter->SenderId = 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 SenderId property.
Console::WriteLine("Message.SenderId: {0}", 
    orderMessage->SenderId);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's SenderId property.
queue.MessageReadPropertyFilter.SenderId = 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 SenderId property.
Console.WriteLine("Message.SenderId: {0}",
    orderMessage.SenderId);

Uwagi

Właściwość SenderIdMessage klasy jest używana głównie przez odbierającego menedżera kolejek podczas uwierzytelniania komunikatu. Właściwość jest ustawiana przez kolejkę komunikatów i jest używana przez menedżera kolejek do sprawdzania, kto wysłał komunikat i czy nadawca ma prawa dostępu do kolejki odbierającej.

Dotyczy

Zobacz też