MessageQueuePermissionAttribute.PermissionAccess 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定用於使用權限要求的使用權限存取等級。
public:
property System::Messaging::MessageQueuePermissionAccess PermissionAccess { System::Messaging::MessageQueuePermissionAccess get(); void set(System::Messaging::MessageQueuePermissionAccess value); };
public System.Messaging.MessageQueuePermissionAccess PermissionAccess { get; set; }
member this.PermissionAccess : System.Messaging.MessageQueuePermissionAccess with get, set
Public Property PermissionAccess As MessageQueuePermissionAccess
屬性值
MessageQueuePermissionAccess 值的位元組合。
範例
下列程式代碼範例會取得並設定消息佇列許可權屬性 PermissionAccess 的屬性值。
// 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 PermissionAccess property value.
attribute->PermissionAccess = MessageQueuePermissionAccess::Receive;
// Display the new value of the attribute's PermissionAccess property.
Console::WriteLine("attribute->PermissionAccess: {0}",
attribute->PermissionAccess);
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 PermissionAccess property value.
attribute.PermissionAccess = MessageQueuePermissionAccess.Receive;
// Display the new value of the attribute's PermissionAccess property.
Console.WriteLine("attribute.PermissionAccess: {0}",
attribute.PermissionAccess);