MessageQueuePermissionEntryCollection.Remove Method (MessageQueuePermissionEntry)

 

Removes a specified permission entry from this collection.

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

public void Remove(
	MessageQueuePermissionEntry value
)

Parameters

value
Type: System.Messaging.MessageQueuePermissionEntry

The permission entry to remove.

The following code example demonstrates the use of Remove.

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

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

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

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

// Add the entry to the collection.
collection.Add(entry);

// Remove the entry from the collection.
collection.Remove(entry);

.NET Framework
Available since 1.1
Return to top
Show: