共用方式為


MsmqMessage<T>.Acknowledgment 屬性

定義

取得與此訊息相關聯的 Acknowledgment

public:
 property Nullable<System::Messaging::Acknowledgment> Acknowledgment { Nullable<System::Messaging::Acknowledgment> get(); };
public System.Messaging.Acknowledgment? Acknowledgment { get; }
member this.Acknowledgment : Nullable<System.Messaging.Acknowledgment>
Public ReadOnly Property Acknowledgment As Nullable(Of Acknowledgment)

屬性值

與此訊息相關聯的 Acknowledgment。 預設值為 Acknowledgement.None。

範例

if (message.Acknowledgment == Acknowledgment.Receive)
    Console.WriteLine("Message sent with Receive acknowledgment");
If message.Acknowledgment = Acknowledgment.Receive Then
    Console.WriteLine("Message sent with Receive acknowledgment")
End If

備註

接收來自管理佇列的訊息時,您可以使用這個屬性來驗證原始訊息的狀態。

適用於