MessagePropertyFilter.SenderVersion 属性

定义

获取或设置一个值,该值指示接收或查看消息时是否检索 SenderVersion 属性信息。

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

属性值

如果接收 SenderVersion 信息,则为 true;否则为 false。 默认值为 false

属性

示例

下面的代码示例演示如何使用 SenderVersion 属性。

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

注解

SenderVersion类的 Message 属性指定用于发送消息的消息队列的版本。 使用事务处理(仅受消息队列 2.0 及更高版本支持)或数字签名(用于对版本 1.0 发送的消息进行身份验证)等功能时,请务必注意 属性。

Message.SenderVersion 在发送消息时由发送队列管理器设置。

适用于

另请参阅