For an overview of the issues of creating MessageQueue components, see MessageQueue Component Creation.
To create an instance of the MessageQueue component programmatically
[Visual Basic] Dim myMQ as New System.Messaging.MessageQueue [C#] System.Messaging.MessageQueue myMQ = new System.Messaging.MessageQueue();
[Visual Basic] myMQ.Path = ".\MyNewQueue" [C#] myMQ.Path = @".\MyNewQueue";
Note You can refer to the queue by the path to the queue, the queue's automatically generated format name, or by the non-unique descriptive label of the queue. Each of these ways of referencing a queue has its advantages and disadvantages. For details, see Queue Reference Recommendations.
MessageQueue Component Creation | Message Queue Configuration Properties | Accessing Server Explorer