This documentation is archived and is not being maintained.

MessageQueue.Label Property

Gets or sets the queue description.

[Visual Basic]
Public Property Label As String
public string Label {get; set;}
public: __property String* get_Label();
public: __property void set_Label(String*);
public function get Label() : String;
public function set Label(String);

Property Value

The label for the message queue. The default is an empty string ("").


Exception Type Condition
ArgumentException The label was set to an invalid value.
MessageQueueException An error occurred when accessing a Message Queuing API.


The maximum length of a message queue label is 124 characters.

The Label property does not need to be unique across all queues. However, if multiple queues share the same Label, you cannot use the Send method to broadcast a message to all of them. If you use the label syntax for the Path property when you send the message, an exception will be thrown if the Label is not unique.

The following table shows whether this property is available in various Workgroup modes.

Workgroup Mode Available
Local computer Yes
Local computer + direct format name Yes
Remote computer No
Remote computer + direct format name No


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

MessageQueue Class | MessageQueue Members | System.Messaging Namespace | Path | FormatName | GetPublicQueuesByLabel | GetPublicQueues | GetMessageQueueEnumerator