Επεξεργασία

Κοινή χρήση μέσω


MessageQueue.QueueName Property

Definition

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

Property Value

The name that identifies the queue referenced by this MessageQueue. The value cannot be null.

Attributes

Exceptions

The queue name is null.

Examples

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);

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

Applies to

See also