共用方式為


MessagePropertyFilter.TimeToReachQueue 屬性

定義

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

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

屬性值

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

屬性

範例

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

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

備註

類別 TimeToReachQueueMessage 屬性會指定從訊息傳送到目的地佇列的時間,以秒為單位的時間限制。

適用於

另請參閱