共用方式為


MessagePropertyFilter.DestinationQueue 屬性

定義

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

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

屬性值

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

屬性

範例

下列程式代碼範例示範 屬性的使用 DestinationQueue

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

備註

類別 DestinationQueueMessage 屬性會識別訊息的原始目的地佇列。 它通常用來判斷日誌或寄不出的信件佇列中訊息的原始目的地。 它也可以在將回應消息傳回回應佇列時使用。

適用於

另請參閱