This documentation is archived and is not being maintained.

MessageQueue.Category Property

Gets or sets the queue category.

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

public Guid Category { get; set; }
/** @property */
public Guid get_Category ()

/** @property */
public void set_Category (Guid value)

public function get Category () : Guid

public function set Category (value : Guid)

Property Value

A Guid that represents the queue category (Message Queuing type identifier), which allows an application to categorize its queues. The default is Guid.empty.

Exception typeCondition

ArgumentException

The queue category was set to an invalid value.

MessageQueueException

An error occurred when accessing a Message Queuing method.

The queue category allows an application to categorize its queues. For example, you can place all Billing queues in one category and all Order queues in another.

The Category property provides access to the Message Queuing Type ID property (which is read/write), accessible through the Queue Properties dialog box in the Computer Management Console. You can define a new category. Although you can use NewGuid to create a category value that is unique across all Guid values, such an action is unnecessary. The category value needs to be distinct only from other categories, not from all other Guid values. For example, you can assign {00000000-0000-0000-0000-000000000001} as the Category for one set of queues and {00000000-0000-0000-0000-000000000002} as the Category for another set.

It is not necessary to set the Category. The value can be a null reference (Nothing in Visual Basic).

Setting this property modifies the Message Queuing queue. Therefore, any other MessageQueue instances are affected by the change.

The following table shows whether this property is available in various Workgroup modes.

Workgroup mode

Available

Local computer

Yes

Local computer and direct format name

Yes

Remote computer

No

Remote computer and direct format name

No

The following code example gets and sets the value of a message queue's Category property.

// Set the queue's Category property value.
queue.Category =
    new System.Guid("00000000-0000-0000-0000-000000000001");

// Display the new value of the queue's Category property.
Console.WriteLine("MessageQueue.Category: {0}", queue.Category);

// Set the queue's Category property value.
queue.set_Category(
    new System.Guid("00000000-0000-0000-0000-000000000001"));
// Display the new value of the queue's Category property.
Console.WriteLine("MessageQueue.Category: {0}", queue.get_Category());

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

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
Show: