This topic has not yet been rated - Rate this topic

MessageQueue.QueueName Property

Gets or sets the friendly name that identifies the queue.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)
[MessagingDescriptionAttribute("MQ_QueueName")]
[BrowsableAttribute(false)]
public string QueueName { get; set; }

Property Value

Type: System.String
The name that identifies the queue referenced by this MessageQueue. The value cannot be null.
Exception Condition
ArgumentException

The queue name is null.

You can combine the QueueName with the MachineName to create a friendly Path name for the queue. The syntax for the friendly name variation of the Path property depends on the type of queue, as shown in the following table.

Queue type

Syntax

Public queue

MachineName\QueueName

Private queue

MachineName\Private$\QueueName

Journal queue

MachineName\QueueName\Journal$

Use "." to represent the local computer.

Changing the QueueName property affects the Path property. If you set the QueueName without setting the MachineName property, the Path property becomes .\QueueName. Otherwise, the Path becomes MachineName\QueueName.

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

Workgroup mode

Available

Local computer

Yes

Local computer and direct format name

Yes

Remote computer

Yes

Remote computer and direct format name

No

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


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

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


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ