Message.UseEncryption 属性

定义

获取或设置一个值,该值指示是否使消息成为私有的。Gets or sets a value that indicates whether to make the message private.

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

属性值

要求消息队列加密消息时为 true;否则为 falsetrue to require Message Queuing to encrypt the message; otherwise, false. 默认值为 falseThe default is false.

属性

异常

消息队列经过筛选后忽略了 UseEncryption 属性。The message queue is filtered to ignore the UseEncryption property.

示例

下面的代码示例获取并设置消息的UseEncryption属性的值。The following code example gets and sets the value of a message's UseEncryption property.

注解

如果消息是私有的, 则在发送和解密消息时, 消息的正文会被加密。If a message is private, its body is encrypted before it is sent and decrypted when it is received. 若要发送专用消息, 发送应用程序必须指定使用加密, 并根据需要指定加密算法。To send a private message, the sending application must specify that encryption be used and, optionally, the encryption algorithm.

发送专用消息时, 应用程序不需要执行消息加密。When sending private messages, your application does not need to perform the message encryption. 如果你的应用程序在 Microsoft Windows 2000 企业内发送消息, 并且该企业有权访问目录服务, 则消息队列可以为你加密消息正文。Message Queuing can encrypt the message body for you if your application is sending messages within a Microsoft Windows 2000 enterprise, which has access to the directory service. 接收专用消息时, 接收队列管理器始终会解密消息正文。When receiving private messages, the receiving Queue Manager always decrypts the message body.

适用于

另请参阅