MessageQueuePermissionEntry.Category 属性

定义

获取队列类别。

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

属性值

队列类别(消息队列类型标识符),它允许应用程序将其队列分类。

示例

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

// 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 Category property.
Console::WriteLine("Category: {0}", entry->Category->ToString());

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 Category property.
Console.WriteLine("Category: {0}", entry.Category.ToString());

适用于