Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.Messaging
MessageQueue Class
 QueueName Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
MessageQueue.QueueName Property

Gets or sets the friendly name that identifies the queue.

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

Visual Basic (Declaration)
Public Property QueueName As String
Visual Basic (Usage)
Dim instance As MessageQueue
Dim value As String

value = instance.QueueName

instance.QueueName = value
C#
public string QueueName { get; set; }
C++
public:
property String^ QueueName {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_QueueName ()

/** @property */
public void set_QueueName (String value)
JScript
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.

C#
// 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);
J#
// 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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker