共用方式為


Message.Label 屬性

定義

取得或設定一個由應用程式定義的 Unicode 字串來描述訊息。

public:
 property System::String ^ Label { System::String ^ get(); void set(System::String ^ value); };
[System.Messaging.MessagingDescription("MsgLabel")]
public string Label { get; set; }
[<System.Messaging.MessagingDescription("MsgLabel")>]
member this.Label : string with get, set
Public Property Label As String

屬性值

訊息的標籤。 預設為空字串(“”)。

屬性

例外狀況

訊息佇列會被過濾以忽略該 Label 屬性。

範例

以下程式碼範例取得 Label 並設定訊息屬性的值。

備註

你可以用訊息標籤來做多種用途。 例如,你可以用它來顯示或根據標籤值選擇性處理訊息。 標籤不需要在不同訊息間是唯一的。

訊息佇列與訊息標籤代表應用程式定義的值,有助於以人類易讀的方式識別佇列或訊息。 應用程式有責任解讀標籤內容,而這些內容對訊息佇列應用程式本身並無內在意義。

適用於

另請參閱