MessageQueue.QueueName Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the friendly name that identifies the queue.
public:
property System::String ^ QueueName { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
[System.Messaging.MessagingDescription("MQ_QueueName")]
public string QueueName { get; set; }
[<System.ComponentModel.Browsable(false)>]
[<System.Messaging.MessagingDescription("MQ_QueueName")>]
member this.QueueName : string with get, set
Public Property QueueName As String
The name that identifies the queue referenced by this MessageQueue. The value cannot be null
.
- Attributes
The queue name is null
.
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);
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 |
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: