This documentation is archived and is not being maintained.
MessageQueuePermissionAccess Enumeration
Visual Studio 2010
Defines access levels used by System.Messaging permission classes.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: System.MessagingAssembly: System.Messaging (in System.Messaging.dll)
| Member name | Description | |
|---|---|---|
| None | The MessageQueue has no permissions. | |
| Browse | The MessageQueue can look at the queues that are available. | |
| Send | The MessageQueue can look at the queues that are available and send messages. | |
| Peek | The MessageQueue can look at the queues that are available and read the messages in the queue. | |
| Receive | The MessageQueue can look at the queues that are available, read the messages in the queue, and receive messages. | |
| Administer | The MessageQueue can look at the queues that are available, read the messages in the queue, and send and receive messages. |
The following code example uses MessageQueuePermissionAccess in creating a new instance of MessageQueuePermission.
#using <System.dll> #using <System.Messaging.dll> using namespace System; using namespace System::Messaging; // Creates a new queue. void CreateQueue(String^ queuePath, bool transactional) { if (!MessageQueue::Exists(queuePath)) { MessageQueue^ queue = MessageQueue::Create(queuePath, transactional); queue->Close(); } else { Console::WriteLine("{0} already exists.",queuePath); } } // Demonstrates the use of MessageQueuePermissionAccess void CreatePermission() { // Connect to a queue on the local computer. MessageQueue^ queue = gcnew MessageQueue(".\\exampleQueue"); // Create a new instance of MessageQueuePermission. MessageQueuePermission^ permission = gcnew MessageQueuePermission( MessageQueuePermissionAccess::Receive, queue->MachineName, queue->Label, queue->Category.ToString()); queue->Close(); } int main() { try { // Create a non-transactional queue on the local computer. CreateQueue(".\\exampleQueue", false); // Demonstrate use of MessageQueuePermissionAccess. CreatePermission(); } catch (InvalidOperationException^) { Console::WriteLine("Please install Message Queuing."); } catch (MessageQueueException^ ex) { Console::WriteLine(ex->Message); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: