我在解决winfom中的解决方案管理器中引入了System.Messaging
可是把MessageQueue组件拖到窗体上就报错 :
创建组件"MessageQueue"失败。错误消息为:
"System.InvalidOperationException:"此计算机上尚未安装消息队列
在System.Messaging.Interop.UnsafeNativeMethods.MQGetQueueProperties(string formatName,MQPROPS queueProperties)
.....
....
想问下 该如何解决 谢谢大家!
可是把MessageQueue组件拖到窗体上就报错 :
创建组件"MessageQueue"失败。错误消息为:
"System.InvalidOperationException:"此计算机上尚未安装消息队列
在System.Messaging.Interop.UnsafeNativeMethods.MQGetQueueProperties(string formatName,MQPROPS queueProperties)
.....
....
想问下 该如何解决 谢谢大家!
解决方案 »
- 看来就有分啊 dottrace 使用问题 帮帮我吧!
- 做个调查,如果不考虑性能,数组从0开始好,还是从1开始好?
- 在c#中,怎样动态生成SerialPort类的实例及操作
- 有没有比较简单的方法, 来去掉String中的所有的类似于 这样的字串?
- 新人提问 关于动态建立线程的问题
- c#中基于socket在传送图片
- 做类似于这样一个网站(http://www.glvchina.com/chinese/main.php)需要多少Money?
- 如何给ListBox中的项加上tip?急。。。
- 任意数相加算法问题
- 如何让一个C#应用程序在一台机器上只启动一次?
- 播放的音乐隐藏下载
- 高分求救 .NET 2.0 SP1 安装问题
“消息队列”技术允许在不同时间运行的应用程序在可能暂时脱机的异类网络和系统之间进行通信。应用程序发送、接收或查看(读取而不移除)队列中的消息。“消息队列”是 Windows 2000 和 Windows NT 的可选组件,而且必须单独安装。MessageQueue 类是“消息队列”周围的包装。“消息队列”有多个版本,而且根据所使用的操作系统的不同,使用 MessageQueue 类可能导致行为上的细微差异。有关每个“消息队列”版本的特定功能的信息,请参见 MSDN 中 Platform SDK 的“What's New in Message Queuing”(“消息队列”的新增功能)主题。using System.Messaging;namespace MyProject
{
/// <summary>
/// Provides a container class for the example.
/// </summary>
public class MyNewQueue
{ //**************************************************
// Provides an entry point into the application.
//
// This example demonstrates several ways to set
// a queue's path.
//************************************************** public static void Main()
{
// Create a new instance of the class.
MyNewQueue myNewQueue = new MyNewQueue(); myNewQueue.SendPublic();
myNewQueue.SendPrivate();
myNewQueue.SendByLabel();
myNewQueue.SendByFormatName();
myNewQueue.MonitorComputerJournal();
myNewQueue.MonitorQueueJournal();
myNewQueue.MonitorDeadLetter();
myNewQueue.MonitorTransactionalDeadLetter(); return;
}
// References public queues.
public void SendPublic()
{
MessageQueue myQueue = new MessageQueue(".\\myQueue");
myQueue.Send("Public queue by path name."); return;
} // References private queues.
public void SendPrivate()
{
MessageQueue myQueue = new
MessageQueue(".\\Private$\\myQueue");
myQueue.Send("Private queue by path name."); return;
} // References queues by label.
public void SendByLabel()
{
MessageQueue myQueue = new MessageQueue("Label:TheLabel");
myQueue.Send("Queue by label."); return;
} // References queues by format name.
public void SendByFormatName()
{
MessageQueue myQueue = new
MessageQueue("FormatName:Public=5A5F7535-AE9A-41d4" +
"-935C-845C2AFF7112");
myQueue.Send("Queue by format name."); return;
} // References computer journal queues.
public void MonitorComputerJournal()
{
MessageQueue computerJournal = new
MessageQueue(".\\Journal$");
while(true)
{
Message journalMessage = computerJournal.Receive();
// Process the journal message.
}
} // References queue journal queues.
public void MonitorQueueJournal()
{
MessageQueue queueJournal = new
MessageQueue(".\\myQueue\\Journal$");
while(true)
{
Message journalMessage = queueJournal.Receive();
// Process the journal message.
}
}
// References dead-letter queues.
public void MonitorDeadLetter()
{
MessageQueue deadLetter = new
MessageQueue(".\\DeadLetter$");
while(true)
{
Message deadMessage = deadLetter.Receive();
// Process the dead-letter message.
}
} // References transactional dead-letter queues.
public void MonitorTransactionalDeadLetter()
{
MessageQueue TxDeadLetter = new
MessageQueue(".\\XactDeadLetter$");
while(true)
{
Message txDeadLetter = TxDeadLetter.Receive();
// Process the transactional dead-letter message.
}
} }
}