MessageQueuePermissionEntry.MachineName 属性

定义

获取“消息队列”队列所在的计算机的名称。

public:
 property System::String ^ MachineName { System::String ^ get(); };
public string MachineName { get; }
member this.MachineName : string
Public ReadOnly Property MachineName As String

属性值

队列所在的计算机的名称。

示例

下面的代码示例显示消息队列权限条目的 MachineName 属性的值。

// Connect to a queue on the local computer.
MessageQueue^ queue = gcnew MessageQueue(".\\exampleQueue");

// Create a new instance of MessageQueuePermissionEntry.
MessageQueuePermissionEntry^ entry = gcnew MessageQueuePermissionEntry(
    MessageQueuePermissionAccess::Receive,
    queue->MachineName,
    queue->Label,
    queue->Category.ToString());

// Display the value of the entry's MachineName property.
Console::WriteLine("MachineName: {0}", entry->MachineName);

queue->Close();
// Connect to a queue on the local computer.
MessageQueue queue = new MessageQueue(".\\exampleQueue");

// Create a new instance of MessageQueuePermissionEntry.
MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
    MessageQueuePermissionAccess.Receive,
    queue.MachineName,
    queue.Label,
    queue.Category.ToString());

// Display the value of the entry's MachineName property.
Console.WriteLine("MachineName: {0}", entry.MachineName);

适用于