共用方式為


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

屬性值

true 表示接收 SenderVersion 資訊,否則為 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);

備註

類別 SenderVersionMessage 屬性會指定用來傳送訊息的 Message Queuing 版本。 當使用事務處理等功能時,此屬性很重要,這隻支援消息佇列 2.0 版和更新版本,或數位簽名,用來驗證第 1.0 版所傳送的訊息。

Message.SenderVersion 是由傳送訊息時的傳送佇列管理員所設定。

適用於

另請參閱