MessageQueuePermissionAttribute.Label Proprietà

Definizione

Ottiene o imposta la descrizione della coda.

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

Valore della proprietà

Etichetta della coda di messaggi.

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 Label 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 Label property value, based on the queue's Label
// property value.
attribute->Label = queue->Label;

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

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 Label property value, based on the queue's Label
// property value.
attribute.Label = queue.Label;

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

Si applica a