惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
O
OpenAI News
WordPress大学
WordPress大学
P
Proofpoint News Feed
J
Java Code Geeks
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Register - Security
The Register - Security
Engineering at Meta
Engineering at Meta
H
Help Net Security
人人都是产品经理
人人都是产品经理
Vercel News
Vercel News
N
Netflix TechBlog - Medium
F
Full Disclosure
U
Unit 42
Latest news
Latest news
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
InfoQ
L
LINUX DO - 最新话题
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
爱范儿
爱范儿
K
Kaspersky official blog
Google Online Security Blog
Google Online Security Blog
小众软件
小众软件
I
Intezer
V
V2EX
S
SegmentFault 最新的问题
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
Security Archives - TechRepublic
Security Archives - TechRepublic
Recent Announcements
Recent Announcements
C
Check Point Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Recorded Future
Recorded Future
博客园 - Franky
Project Zero
Project Zero
S
Securelist
Attack and Defense Labs
Attack and Defense Labs
Spread Privacy
Spread Privacy
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
S
Secure Thoughts
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed

博客园 - billqi(岁月如水)

解除webservice上下传文件大小限制 [转贴]请不要做浮躁的人! BBS 水木清华站 msmq两个网域之间消息传输与接收测试总结 PDA 应用领域 GPS的十大绝技 GSM - billqi(岁月如水) - 博客园 深圳面试提醒(特别针对女生) CRM功能架构 VMI的理念与应用 台湾供货商管理库存(VMI)导入指引 SMART原则与自我激励 msmq 之触发器 微软架构师网站 绩效考核的KPI及SMART原则 微软.net framework工具集帮助 sql查询语句问题- sum求和的值作为查询条件 2年前的建议书 Server群集部署? 新的天地
msmq消息队列使用及测试总结
billqi(岁月如水) · 2005-12-23 · via 博客园 - billqi(岁月如水)

//测试环境说明
//1,发送与接收应用程序客户端:window2003 server, window2000 server,window xp;
//2,msmq server :window2003 server +活动目录(已经为msmq消息队列的everynone帐户设置了所有权限)

//消息发送测试代码
try
   {
    System.Messaging.MessageQueue Queue;
    Queue = new System.Messaging.MessageQueue(@"FormatName:DIRECT=TCP:172.26.230.2\ptest1");
    
    System.Messaging.Message Msg;
    Msg = new System.Messaging.Message();
    Msg.Formatter =new System.Messaging.BinaryMessageFormatter();
    Msg.Body="Testing 3 times";
    Queue.Send(Msg);
   }
   catch(Exception ex)
   {
    System.Windows.Forms.MessageBox.Show(ex.ToString());
   }  

//消息接收测试代码
try
   {
    System.Messaging.MessageQueue mq = new System.Messaging.MessageQueue(@"FormatName:DIRECT=tcp:172.26.230.2\ptest1");

    // Set the queue'ss formatter to decode Point objects

    mq.Formatter = new System.Messaging.BinaryMessageFormatter();
    System.Messaging.Trustee trustee=new System.Messaging.Trustee();
    
    System.Messaging.Message msg = mq.Peek ( new TimeSpan(10000)) ;


    // Convert received message to object that we think was sent

    string pt = (string) msg.Body ;

    // Display it to the user
    
    MessageBox.Show (pt) ;
   }
   catch(Exception ex)
   {
    MessageBox.Show(ex.ToString());
   }


//运行结果说明
//1, 所有操作系统类型的客户端向远程msmq服务器发送消息成功
//2,window2000环境下从远程服务器接收消息成功
//   window xp客户端接收失败
//   window 2003(未安装活动目录)部分客户端接收成功,部分失败
//   window 2003(安装活动目录)所有客户端接收消息失败    
//3,异常讯息如下:
/*
---------------------------

System.Messaging.MessageQueueException

   at System.Messaging.MQCacheableInfo.get_ReadHandle()

   at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, IntPtr cursorHandle, IntPtr transaction)

   at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, IntPtr cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)

   at System.Messaging.MessageQueue.Peek(TimeSpan timeout)

   at InternetQueueingRecipient.Form1.button2_Click(Object sender, EventArgs e) in c:\msmqandnet\msmqandnet\internetqueuing\internetqueueingrecipient\form1.cs:line 294
*/

疑问:msmq3.0远程接收消息时,客户端要做何种配置,服务器端要做何种配置?原因与原理?msmq远程读取消息的使用的默认帐户为
什么?