Export (0) Print
Expand All
Expand Minimize

MessageQueuePermissionAccess Enumeration

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.Messaging
Assembly: System.Messaging (in system.messaging.dll)

[SerializableAttribute] 
[FlagsAttribute] 
public enum MessageQueuePermissionAccess
/** @attribute SerializableAttribute() */ 
/** @attribute FlagsAttribute() */ 
public enum MessageQueuePermissionAccess
SerializableAttribute 
FlagsAttribute 
public enum MessageQueuePermissionAccess

 Member nameDescription
Supported by the .NET Compact FrameworkAdministerThe MessageQueue can look at the queues that are available, read the messages in the queue, and send and receive messages. 
Supported by the .NET Compact FrameworkBrowseThe MessageQueue can look at the queues that are available. 
Supported by the .NET Compact FrameworkNoneThe MessageQueue has no permissions. 
Supported by the .NET Compact FrameworkPeekThe MessageQueue can look at the queues that are available and read the messages in the queue. 
Supported by the .NET Compact FrameworkReceiveThe MessageQueue can look at the queues that are available, read the messages in the queue, and receive messages. 
Supported by the .NET Compact FrameworkSendThe MessageQueue can look at the queues that are available and send messages. 

The following code example uses MessageQueuePermissionAccess in creating a new instance of MessageQueuePermission.


using System;
using System.Messaging;

public class MessageQueuePermissionAccessExample
{
    public static void Main()
    {
        // Create a new instance of the class.
        MessageQueuePermissionAccessExample example =
            new MessageQueuePermissionAccessExample();

        // Create a non-transactional queue on the local computer.
        CreateQueue(".\\exampleQueue", false);

        // Demonstrate use of MessageQueuePermissionAccess.
        example.CreatePermission();
    }

    // Creates a new queue.
    public static void CreateQueue(string queuePath, bool transactional)
    {
        if(!MessageQueue.Exists(queuePath))
        {
            MessageQueue.Create(queuePath, transactional);
        }
        else
        {
            Console.WriteLine(queuePath + " already exists.");
        }
    }

    // Demonstrates the use of MessageQueuePermissionAccess
    public void CreatePermission()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");
	string machineName = queue.MachineName;
	string label = queue.Label;
        string category = queue.Category.ToString();
        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission(
            MessageQueuePermissionAccess.Receive,
            machineName,
            label,
            category);
    }
}


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft