MessageQueuePermissionEntry 构造函数

定义

初始化 MessageQueuePermissionEntry 类的新实例。

重载

MessageQueuePermissionEntry(MessageQueuePermissionAccess, String)

通过指定的权限访问级别和队列的路径初始化 MessageQueuePermissionEntry 类的新实例。

MessageQueuePermissionEntry(MessageQueuePermissionAccess, String, String, String)

通过指定的权限访问级别、队列所在的计算机的名称、队列说明和查询类别初始化 MessageQueuePermissionEntry 类的新实例。

MessageQueuePermissionEntry(MessageQueuePermissionAccess, String)

通过指定的权限访问级别和队列的路径初始化 MessageQueuePermissionEntry 类的新实例。

public:
 MessageQueuePermissionEntry(System::Messaging::MessageQueuePermissionAccess permissionAccess, System::String ^ path);
public MessageQueuePermissionEntry (System.Messaging.MessageQueuePermissionAccess permissionAccess, string path);
new System.Messaging.MessageQueuePermissionEntry : System.Messaging.MessageQueuePermissionAccess * string -> System.Messaging.MessageQueuePermissionEntry
Public Sub New (permissionAccess As MessageQueuePermissionAccess, path As String)

参数

permissionAccess
MessageQueuePermissionAccess

MessageQueuePermissionAccess 值的按位组合。 PermissionAccess 属性被设置为该值。

path
String

MessageQueue 对象引用的队列的路径。 Path 属性被设置为该值。

示例

下面的代码示例创建 的新 MessageQueuePermissionEntry实例。

// 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->Path);

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.Path);

适用于

MessageQueuePermissionEntry(MessageQueuePermissionAccess, String, String, String)

通过指定的权限访问级别、队列所在的计算机的名称、队列说明和查询类别初始化 MessageQueuePermissionEntry 类的新实例。

public:
 MessageQueuePermissionEntry(System::Messaging::MessageQueuePermissionAccess permissionAccess, System::String ^ machineName, System::String ^ label, System::String ^ category);
public MessageQueuePermissionEntry (System.Messaging.MessageQueuePermissionAccess permissionAccess, string machineName, string label, string category);
new System.Messaging.MessageQueuePermissionEntry : System.Messaging.MessageQueuePermissionAccess * string * string * string -> System.Messaging.MessageQueuePermissionEntry
Public Sub New (permissionAccess As MessageQueuePermissionAccess, machineName As String, label As String, category As String)

参数

permissionAccess
MessageQueuePermissionAccess

MessageQueuePermissionAccess 值的按位组合。 PermissionAccess 属性被设置为该值。

machineName
String

“消息队列”队列所在的计算机的名称。 MachineName 属性被设置为该值。

label
String

队列说明。 Label 属性被设置为该值。

category
String

队列类别(消息队列类型标识符)。 Category 属性被设置为该值。

示例

下面的代码示例创建 的新 MessageQueuePermissionEntry实例。

// 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());

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());

适用于