Udostępnij przez


MessagePropertyFilter.AttachSenderId Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy pobierać AttachSenderId informacje o właściwości podczas odbierania lub podglądu 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

true aby otrzymywać AttachSenderId informacje; w przeciwnym razie false. Wartość domyślna to false.

Atrybuty

Przykłady

Poniższy przykład kodu przedstawia 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ść AttachSenderIdMessage klasy określa, czy Message.SenderId powinna być dołączona do komunikatu, czy też została dołączona. Element Message.SenderId jest ustawiany przez kolejkowanie komunikatów i jest używany przez odbierającego Menedżera kolejki w celu sprawdzenia, czy nadawca ma prawa dostępu do kolejki.

Dotyczy

Zobacz też