共用方式為


MessagePropertyFilter.Authenticated 屬性

定義

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

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

屬性值

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

屬性

範例

下列程式代碼範例示範 如何使用 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);
// 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 屬性來判斷是否已要求驗證。 如果要求驗證且訊息位於佇列中,則會驗證訊息。

無法查看訊息的屬性,並判斷訊息是否驗證失敗。 失敗驗證的訊息會被捨棄,而且不會傳遞至佇列。

適用於

另請參閱