疑难杂症呀,请大家进来看看
我有两台机子,一台装了vs2003,还有一台是只装framework 1.1我把写了一段建议消息队列的程序,在装有vs2003(操作系统(WIn2000))机子上调通了,但在framework 1.1机子上(操作系统XP)始终出现错误,(注,两台机子都装有消息队列,队列名是myqueue)
接收程序:
static void Main(string[] args)
{
string mInfo;
mInfo=".\\Private$\\myqueue";
if (MessageQueue.Exists(mInfo))
{
System.Messaging.MessageQueue mq = new MessageQueue(mInfo);
Console.WriteLine("start");
string[] types = { "System.String" };
((XmlMessageFormatter)mq.Formatter).TargetTypeNames = types;
System.Messaging.Message m=mq.Receive();
string path=(string)m.Body;
Console.WriteLine(path);
}
}
发送程序:
static void Main(string[] args)
{
string mInfo;
mInfo=".\\Private$\\myqueue";
MessageQueue myQueue = new MessageQueue(mInfo);
myQueue.Send("success");
}
大家帮我看看撒
谢谢