更新时间:2023-11-25 12:57:40
MSDN帮助页面提供有关的MessageQueue ;你有解决问题所需的一切:
https://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.getprivatequeuesbymachine%28v=vs.110%29.aspx [ ^ ],
MessageQueue类(System.Messaging) [ ^ ],
MessageQueue.GetAllMessages方法(System.Messaging) [ ^ ]。
注意GetAllMessages
函数的最后一个链接。它返回消息数组,您可以使用它来查看是否有消息。只需调用数组的属性长度
。
不清楚你的意思是有多少消息和邮件正文;这个表达式在语法上和逻辑上都不正确。无论如何,获取消息数组并查看你想要的任何内容。-SA
MSDN help page provide comprehensive information onMessageQueue
; you have all you need to solve your problem:
https://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.getprivatequeuesbymachine%28v=vs.110%29.aspx[^],
MessageQueue Class (System.Messaging)[^],
MessageQueue.GetAllMessages Method (System.Messaging)[^].
Note the last link to theGetAllMessages
function. It returns the message array, which you can use to see if there any messages. Just call the array's propertyLength
.
It's not clear what you mean by "how many messages are there and message body"; this expression is not grammatically and logically correct. Anyway, get the message array and look at whatever you want.—SA