MessageQueuePermissionAttribute.Category Proprietà

Definizione

Ottiene o imposta la categoria della coda.

public:
 property System::String ^ Category { System::String ^ get(); void set(System::String ^ value); };
public string Category { get; set; }
member this.Category : string with get, set
Public Property Category As String

Valore della proprietà

Categoria della coda, identificatore del tipo Accodamento messaggi, che consente a un'applicazione di suddividere per categoria le proprie code.

Eccezioni

Il valore è null.

Esempio

L'esempio di codice seguente ottiene e imposta il valore della proprietà dell'attributo di autorizzazione di una coda di Category messaggi.


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

// Create a new instance of MessageQueuePermissionAttribute.
MessageQueuePermissionAttribute^ attribute =
    gcnew MessageQueuePermissionAttribute(
    System::Security::Permissions::SecurityAction::Assert);

// Set the attribute's Category property value, based on the queue's
// Category property value.
attribute->Category = queue->Category.ToString();

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

queue->Close();

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

// Create a new instance of MessageQueuePermissionAttribute.
MessageQueuePermissionAttribute attribute =
    new MessageQueuePermissionAttribute(
    System.Security.Permissions.SecurityAction.Assert);

// Set the attribute's Category property value, based on the queue's
// Category property value.
attribute.Category = queue.Category.ToString();

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

Si applica a