MessagePropertyFilter.AttachSenderId Proprietà

Definizione

Ottiene o imposta un valore che indica se recuperare le informazioni della proprietà AttachSenderId quando si riceve o si visualizza un messaggio.

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

Valore della proprietà

true per ricevere le informazioni di AttachSenderId; false in caso contrario. Il valore predefinito è false.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato l'uso AttachSenderId della proprietà.

// 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);

Commenti

La AttachSenderId proprietà della Message classe specifica se Message.SenderId deve essere o è stata associata al messaggio. L'oggetto Message.SenderId è impostato da Accodamento messaggi e viene usato da Gestione code di ricezione per verificare se il mittente dispone dei diritti di accesso a una coda.

Si applica a

Vedi anche