Message.Label 属性

定义

获取或设置描述消息的应用程序定义的 Unicode 字符串。Gets or sets an application-defined Unicode string that describes the message.

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

属性值

消息的标签。The label of the message. 默认值为空字符串("")。The default is an empty string ("").

属性

异常

消息队列经过筛选后忽略了 Label 属性。The message queue is filtered to ignore the Label property.

示例

下面的代码示例获取并设置消息的Label属性的值。The following code example gets and sets the value of a message's Label property.

注解

消息标签有多种用途。You can use a message label for several purposes. 例如,可用于显示消息,或根据标签值有选择地处理消息。For example, you can use it for display purposes or to selectively process messages based on the label value. 此标签在消息中不必是唯一的。The label does not need to be unique across messages.

消息队列和消息标签表示一个应用程序定义的值,可利用该值将标识队列或消息用人可识别的词条标识出来。Message queue and message labels represent an application-defined value that can help identify the queue or message in human-readable terms. 应用程序负责解释标签内容, 这对 "消息队列" 应用程序没有内部意义。It is the responsibility of the application to interpret the label contents, which have no intrinsic meaning to the Message Queuing application.

适用于

另请参阅