共用方式為


MessagePropertyFilter.EncryptionAlgorithm 屬性

定義

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

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

屬性值

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

屬性

範例

下列程式代碼範例示範 如何使用 EncryptionAlgorithm 屬性。

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

備註

如果訊息是私用的,則會在收到訊息之前先加密並解密。 類別 EncryptionAlgorithmMessage 屬性會指定用來加密私用訊息訊息內文的演算法。

適用於

另請參閱