MessagePropertyFilter.UseAuthentication 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出在接收或窺視訊息時是否要擷取 UseAuthentication 屬性資訊。
public:
property bool UseAuthentication { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgUseAuthentication")]
public bool UseAuthentication { get; set; }
[<System.Messaging.MessagingDescription("MsgUseAuthentication")>]
member this.UseAuthentication : bool with get, set
Public Property UseAuthentication As Boolean
屬性值
true
表示接收 UseAuthentication 資訊,否則為 false
。 預設為 false
。
- 屬性
範例
下列程式代碼範例示範 屬性的使用 UseAuthentication 。
// Set the queue's MessageReadPropertyFilter property
// to enable the message's UseAuthentication property.
queue->MessageReadPropertyFilter->
UseAuthentication = 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
// UseAuthentication property.
Console::WriteLine("Message.UseAuthentication: {0}",
orderMessage->UseAuthentication);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's UseAuthentication property.
queue.MessageReadPropertyFilter.UseAuthentication = 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 UseAuthentication property.
Console.WriteLine("Message.UseAuthentication: {0}",
orderMessage.UseAuthentication);
備註
類別 UseAuthentication 的 Message 屬性會指定是否需要驗證訊息。
無法查看訊息的屬性,並判斷訊息是否失敗驗證。 失敗驗證的訊息會被捨棄,而且不會傳遞至佇列。