MessageQueue.Label Property

Gets or sets the queue description.

Namespace: System.Messaging
Assembly: System.Messaging (in system.messaging.dll)

public string Label { get; set; }
/** @property */
public String get_Label ()

/** @property */
public void set_Label (String value)

public function get Label () : String

public function set Label (value : String)

Property Value

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

Exception typeCondition


The label was set to an invalid value.


An error occurred when accessing a Message Queuing method.

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(Object) 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


Local computer


Local computer and direct format name


Remote computer


Remote computer and direct format name


The following code example gets and sets the value of a message queue's Label property.

// Set the queue's Label property value.
queue.Label = "Example Queue";

// Display the new value of the queue's Label property.
Console.WriteLine("MessageQueue.Label: {0}",

// Set the queue's Label property value.
queue.set_Label("Example Queue");
// Display the new value of the queue's Label property.
Console.WriteLine("MessageQueue.Label: {0}", queue.get_Label());

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions