


























//Send
MessageQueue MQueue = new MessageQueue(".\\private$\\MQDemo");
System.Messaging.Message Msg = new System.Messaging.Message();
Msg.Body = textBox1.Text;
Msg.Formatter = new System.Messaging.XmlMessageFormatter(new Type[] { typeof(string) });
MQueue .Send(Msg);
//Receive
MessageQueue MQueue = new MessageQueue(".\\private$\\MQDemo");
System.Messaging.Message Msg = MQueue.Receive();
Msg.Formatter = new System.Messaging.XmlMessageFormatter(new Type[] { typeof(string) });
MessageBox.Show(Msg.Body.ToString());
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。