共用方式為


MessagePropertyFilter.SentTime 屬性

定義

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

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

屬性值

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

屬性

範例

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

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

備註

類別 SentTimeMessage 屬性會指出來源佇列管理員傳送訊息的傳送計算機日期和時間。

適用於

另請參閱