MessageQueue.Create Method (String)

 

Creates a non-transactional Message Queuing queue at the specified path.

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

static member Create : 
        path:string -> MessageQueue

Parameters

path
Type: System.String

The path of the queue to create.

Return Value

Type: System.Messaging.MessageQueue

A MessageQueue that represents the new queue.

Exception Condition
ArgumentException

The path parameter is null or is an empty string ("").

MessageQueueException

A queue already exists at the specified path.

-or-

An error occurred when accessing a Message Queuing method.

Use this overload to create a non-transactional Message Queuing queue.

To create a new instance of the MessageQueue class in your application and bind it to an existing queue, use the MessageQueue constructor. To create a new queue in Message Queuing, call Create(String).

The syntax for the path parameter depends on the type of queue it references, as shown in the following table.

Queue type

Syntax

Public queue

MachineName\QueueName

Private queue

MachineName\Private$\QueueName

Use "." for the local computer. For more syntax, see the Path property.

The following table shows whether this method is available in various Workgroup modes.

Workgroup mode

Available

Local computer

Yes

Local computer and direct format name

Yes

Remote computer

No

Remote computer and direct format name

No

The following code example creates public and private queues. It sends a message to selected queues.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: