共用方式為


MessagePropertyFilter.UseDeadLetterQueue 屬性

定義

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

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

屬性值

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

屬性

範例

下列程式代碼範例示範 如何使用 UseDeadLetterQueue 屬性。

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

備註

類別 UseDeadLetterQueueMessage 屬性會指定是否應該將無法傳遞的訊息複本傳送至寄不出的信件佇列。

適用於

另請參閱