无权访问私有 MSMQ [英] No permission to access a private MSMQ

查看:16
本文介绍了无权访问私有 MSMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 XP 机器上,有一个由 .net 服务创建的私有消息队列.当我想在 VB6 应用程序中访问这个私有队列时,我不断收到访问被拒绝"错误.所以这似乎是一个安全问题,只是我不明白为什么即使我以管理员身份登录我仍然无法访问在同一台机器上创建的队列.还有什么我需要考虑的吗?

On an XP machine there is a private messagequeue that was created by a .net service. When I want to access this private queue in a VB6 application I keep getting an "Access is denied" error. So it seems this is a security issue, only I don't understand why even when I am logged on as an administrator I still can't have access to queue that was created on the same machine. Is there something else I have to take into account.

关于我如何在 VB6 中使用队列的示例

Sample on how I use the queue in VB6

Public msgQueue As MSMQQueue

Private Sub OpenQueue()

    Dim MQ As New MSMQQueueInfo
        MQ .PathName = ".Private$incommingQueue"

    Set msgQueue = MQ.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)

End Sub

推荐答案

如果 .NET 服务从私有队列的权限中删除了Everyone"组,就会发生这种情况.您可以采取以下步骤来解决此问题:

This can happen if the .NET Service removed the "Everyone" group from the permissions the private queue. Here are some steps you can take to resolve this:

  1. 停止 MSMQ 服务

  1. Stop the MSMQ Service

打开文件夹C:WINDOWSsystem32msmqstoragelqs

在此文件夹中找到描述您的队列的文件 -- (incommingQueue)

Find the file in this folder that describes your queue -- (incommingQueue)

使用记事本打开其他一些具有良好安全权限的私有队列的 lqs 文件.(如果您没有任何其他私有队列,请创建一个)

Using notepad, open the lqs file for some other private queue that has good security permissions. (If you don't have any other private queues create one)

找到文件中以 Security=....

将整行复制到剪贴板(注意自动换行,这一行会很长)

Copy the whole line to your clipboard (watch out for Word Wrap, this line will be quite long)

在文本编辑器中打开问题队列的 lqs 文件

Open the lqs file for your problem queue in your text editor

用剪贴板的内容覆盖此文件中的 Security=...

Overwrite the Security=... line in this file with the contents of your clipboard

保存修改后的lqs文件

Save the modified lqs file

启动 MSMQ 服务

您应该会发现问题队列现在与您在上面第 6 步中复制其安全设置的队列具有相同的权限.

You should find that the problem queue now has the same permissions as the queue whose security settings you copied at step 6 above.

这篇关于无权访问私有 MSMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆