MessageQueueCriteria.MachineName Property


Gets or sets the computer name by which to filter queues in the network.

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

public string MachineName { get; set; }

Property Value

Type: System.String

The server name of the computer on which the queues reside.

Exception Condition

The application did not set the MachineName property before reading it.


The computer name syntax is invalid.

A message queue's MachineName reflects the name of the server on which the queue resides, without preceding backslashes (\\).

If you are filtering only by computer name when searching the queues on the network, you can use the method GetPublicQueuesByMachine, which is specifically designed for this purpose. If you are searching by multiple criteria that include the computer name, set this MachineName property and pass the parameter into GetPublicQueues.

You can also search for private queues on the network by specifying a computer name in the GetPrivateQueuesByMachine method.

.NET Framework
Available since 1.1
Return to top