Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

MessageQueue.QueueName Property

Gets or sets the friendly name that identifies the queue.

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

public string QueueName { get; set; }
/** @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).

Exception typeCondition

ArgumentException

The queue name is a null reference (Nothing in Visual Basic).

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

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

  • 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

ADD
Show:
© 2015 Microsoft