To create a Message Queue manually you can open up Server Explorer inside Visual Studio, opening up the server you want to create the queue on. Open up the Message Queue Node and right click the public or private queses node, depending on where you want to create the queue, and select “Create Queue.” Type the name of Queue you wish to create. Check make queue transactional if desired.

To create the message queue programmatically, add a reference to System Messaging.dll and then use the System.Messaging.MessageQueue.Create to create a queue. Sample code from msdn is below:

//Create a Public QueueSystem.Messaging.MessageQueue.Create(@"myMachine\MyQueue");

To delete a queue manually you can just right click the message queue in server explorer and select delete. To delete the queue programmatically you must call the System.Messaging.MessageQueue.Delete method. Sample code from msdn is below:

System.Messaging.MessageQueue.Delete (@"myMachine\MyQueue");

To set permissions on a queue programmatically call the SetPermissions method of the MessageQueue object that is pointing to the queue you want to administer. You pass in an Access Control List to this method.