Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 调用GetPrivateQueuesByMachine时出错_C#_Message Queue_Msmq - Fatal编程技术网

C# 调用GetPrivateQueuesByMachine时出错

C# 调用GetPrivateQueuesByMachine时出错,c#,message-queue,msmq,C#,Message Queue,Msmq,我只是想从我的电脑上获取服务器上所有专用队列的列表 我得到的错误是“拒绝访问消息队列系统” 我已授予对上队列的完全访问权限(所有人、网络服务和匿名登录),因为只有一个队列 请参阅以下随附的错误和代码:- try { MessageQueue[] queueList = MessageQueue.GetPrivateQueuesByMachine("xxx.xxx.x.xxx");//Err

我只是想从我的电脑上获取服务器上所有专用队列的列表

我得到的错误是“拒绝访问消息队列系统”

我已授予对上队列的完全访问权限(所有人、网络服务和匿名登录),因为只有一个队列

请参阅以下随附的错误和代码:-

       try
       {
            MessageQueue[] queueList =                
            MessageQueue.GetPrivateQueuesByMachine("xxx.xxx.x.xxx");//Error 
            occurs here

            foreach (MessageQueue queueItem in queueList)
            {
                 Console.WriteLine(queueItem.Path);
            }

             return created;
        }
        catch (MessageQueueException m)
        {
            Console.WriteLine(m.Message + m.MessageQueueErrorCode);
        }
        catch (SystemException s)
        {
            Console.WriteLine(s.Message + s.StackTrace);
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }

在目标机器的计算机管理器上(示例中为“xxx.xxx.x.xxx”),选择“服务和应用程序”,然后选择“消息队列”。右键单击“消息队列”,转到安全选项卡并添加您的完全控制帐户。Thsi应该允许您访问该计算机上的专用队列

是的,Maiur无法与MSMQ服务通话,而不是与队列通话。您已经这样做并允许匿名登录,每个人和网络服务…不确定要访问哪个其他帐户…很高兴添加其他帐户-有什么想法吗?@JohnBreakwell-你好,John我很高兴根据需要添加其他帐户…我知道这是一个权限问题…感谢任何进一步的帮助…所有人和匿名登录都是有效包含所有帐户所需的。如果您按照建议将这些权限添加到服务中,而不是像最初发布的那样仅添加到队列中,那么问题就出在其他地方。