MessagePropertyFilter.AttachSenderId Właściwość

Definicja

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

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

Wartość właściwości

Boolean

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

Atrybuty

Przykłady

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

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

Uwagi

Właściwość AttachSenderId Message klasy określa, czy Message.SenderId element powinien być dołączony do komunikatu. Element Message.SenderId jest ustawiany przez kolejkę komunikatów i jest używany przez odbierającego menedżera kolejek w celu sprawdzenia, czy nadawca ma prawa dostępu do kolejki.

Dotyczy

Zobacz też