Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MessageQueuePermissionEntryCollection::AddRange Method (array<MessageQueuePermissionEntry^>^)

 

Appends a set of specified permission entries to this collection.

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

public:
void AddRange(
	array<MessageQueuePermissionEntry^>^ value
)

Parameters

value
Type: array<System.Messaging::MessageQueuePermissionEntry^>^

An array of type MessageQueuePermissionEntry objects that contains the permission entries to add.

The following code example demonstrates the use of AddRange(array<MessageQueuePermissionEntry^>^).

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

// Create a new instance of MessageQueuePermission.
MessageQueuePermission^ permission = gcnew MessageQueuePermission();

// Get an instance of MessageQueuePermissionEntryCollection from the
// permission's PermissionEntries property.
MessageQueuePermissionEntryCollection^ collection =
    permission->PermissionEntries;

// Create an array of type MessageQueuePermissionEntry.
array<MessageQueuePermissionEntry^>^ entries = 
    gcnew array<MessageQueuePermissionEntry^>(1);

// Create a new instance of MessageQueuePermissionEntry and place the
// instance in the array.
entries[0] = gcnew MessageQueuePermissionEntry(
    MessageQueuePermissionAccess::Receive, 
    queue->MachineName, 
    queue->Label, 
    queue->Category.ToString());

// Add the array to the collection.
collection->AddRange(entries);

queue->Close();

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft