共用方式為


MessagePropertyFilter.SenderId 屬性

定義

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

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

屬性值

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

屬性

範例

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

備註

類別 SenderIdMessage 屬性主要是由接收佇列管理員在驗證訊息時使用。 屬性是由消息佇列所設定,佇列管理員會使用此屬性來驗證傳送訊息的人員,以及傳送者具有接收佇列的訪問許可權。

適用於

另請參閱