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 的值。

備註

訊息標籤可以用於多種用途。 例如,您可以將它用於顯示,或者根據標籤值對訊息進行選擇性的處理。 標籤不需要在訊息之間是唯一的。

訊息佇列和訊息標籤表示應用程式定義的值,這個值會以人們可讀取 (Human-Readable) 的詞彙協助識別佇列或訊息。 應用程式必須負責解譯標籤內容,這對消息佇列應用程式沒有內建意義。

適用於

另請參閱