MessagePropertyFilter.Authenticated 属性

定义

获取或设置一个值,该值指示接收或查看消息时是否检索 Authenticated 属性信息。Gets or sets a value that indicates whether to retrieve Authenticated property information when receiving or peeking a message.

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

属性值

Boolean

如果接收 Authenticated 信息,则为 true;否则为 falsetrue to receive Authenticated information; otherwise, false. 默认值为 falseThe default is false.

属性

示例

下面的代码示例演示属性的用法 AuthenticatedThe following code example demonstrates the use of the Authenticated property.

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

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

注解

Authenticated Message 接收应用程序使用类的属性来确定是否已请求身份验证。The Authenticated property of the Message class is used by the receiving application to determine if authentication was requested. 如果请求了身份验证,并且消息在队列中,则会对消息进行身份验证。If authentication was requested and the message is in the queue, then the message is authenticated.

不能查看消息的属性,并确定消息身份验证是否失败。It is not possible to look at the properties of a message and determine whether a message failed authentication. 身份验证失败的消息将被丢弃,且不会传递到队列。Messages that fail authentication are discarded and are not delivered to the queue.

适用于

另请参阅