Поделиться через


MessagePropertyFilter.Id Свойство

Определение

Возвращает или задает значение, указывающее, следует ли получать Id сведения о свойстве при получении или просмотре сообщения.

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

Значение свойства

trueЗначение , falseчтобы получить Id сведения; в противном случае . Значение по умолчанию — true.

Атрибуты

Примеры

В следующем примере кода показано использование Id свойства.

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

Комментарии

Свойство IdMessage класса указывает созданный очередью сообщений уникальный идентификатор сообщения. Этот идентификатор создается при отправке сообщения.

Применяется к

См. также раздел