Gets or sets the friendly name that identifies the queue.
Namespace: System.Messaging
Assembly: System.Messaging (in system.messaging.dll)

Syntax
Visual Basic (Declaration)
Public Property QueueName As String
Dim instance As MessageQueue
Dim value As String
value = instance.QueueName
instance.QueueName = value
public string QueueName { get; set; }
public:
property String^ QueueName {
String^ get ();
void set (String^ value);
}
/** @property */
public String get_QueueName ()
/** @property */
public void set_QueueName (String value)
public function get QueueName () : String
public function set QueueName (value : String)
Property Value
The name that identifies the queue referenced by this
MessageQueue. The value cannot be a null reference (
Nothing in Visual Basic).

Exceptions
| Exception type | Condition |
|---|
ArgumentException | The queue name is a null reference (Nothing in Visual Basic). |

Remarks
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 |

Example
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);
// Set the queue's QueueName property value.
queue.set_QueueName("Example Queue");
// Display the new value of the queue's QueueName property.
Console.WriteLine("MessageQueue.QueueName: {0}",
queue.get_QueueName());

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

Platforms
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.

Version Information
.NET Framework
Supported in: 2.0, 1.1, 1.0
.NET Compact Framework
Supported in: 2.0

See Also