MessagePropertyFilter.AttachSenderId 屬性

定義

取得或設定值,指出在接收或窺視訊息時是否要擷取 AttachSenderId 屬性資訊。

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

屬性值

true 表示接收 AttachSenderId 資訊,否則為 false。 預設為 false

屬性

範例

下列程式代碼範例示範 屬性的使用 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);
// 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);

備註

類別 AttachSenderIdMessage 屬性會 Message.SenderId 指定 應該或 已經附加至訊息。 Message.SenderId是由消息佇列設定,接收佇列管理員會使用 來驗證寄件者是否具有佇列的訪問許可權。

適用於

另請參閱