次の方法で共有


MessageQueuePermissionEntryCollection.Remove メソッド

定義

指定したアクセス許可エントリをコレクションから削除します。

public:
 void Remove(System::Messaging::MessageQueuePermissionEntry ^ value);
public void Remove (System.Messaging.MessageQueuePermissionEntry value);
member this.Remove : System.Messaging.MessageQueuePermissionEntry -> unit
Public Sub Remove (value As MessageQueuePermissionEntry)

パラメーター

value
MessageQueuePermissionEntry

削除するアクセス許可エントリ。

次のコード例は、Remove の使用方法を示します。

// 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 a new instance of MessageQueuePermissionEntry.
MessageQueuePermissionEntry^ entry = gcnew 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);

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

適用対象