共用方式為


MessagePropertyFilter.HashAlgorithm 屬性

定義

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

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

屬性值

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

屬性

範例

下列程式代碼範例示範 屬性的使用 HashAlgorithm

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

備註

類別 HashAlgorithmMessage 屬性會識別驗證訊息時所使用的哈希演算法消息佇列。 建立訊息的數字簽名時,也會使用哈希演算法。

適用於

另請參閱