windows消息队列管理
在vs2005中的代码如下:
public static void SendMessage(string msg)
{
try
{
MessageQueue myQueue = new MessageQueue(".\\private$\\queue1");
Message myMessage = new Message();
myMessage.Body = msg;
myMessage.Formatter = new XmlMessageFormatter(new Type[] { typeof(string) });
myQueue.Send(myMessage);
}
catch (ArgumentException e)
{
Console.WriteLine(e.Message);
}
}
该代码能够成功运行,但是在右键我的电脑-》管理-》服务和应用程序-》消息队列中对应的队列下面看不到插入的消息,请问是为什么,而且receive方法也无法读出消息。谢谢