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


MessagePropertyFilter.SourceMachine Свойство

Определение

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

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

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

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

Атрибуты

Примеры

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

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

Комментарии

Свойство SourceMachineMessage класса указывает компьютер, в котором возникло сообщение.

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

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