简体   繁体   English

从MSMQ删除所有消息

[英]Removing all the messages from MSMQ

I have a Nunit test which adds message into MSMQ. 我有一个Nunit测试,它将消息添加到MSMQ中。 In the teardown of the NUnit i want to remove all the message from the queue. 在NUnit的拆卸中,我想从队列中删除所有消息。 Is there a direct way to remove all the messages from the queue (some kind of refresh) ? 是否有直接方法从队列中删除所有消息(某种刷新)?

Is there a Purge() method on your queue object that would do the trick? 队列对象上是否有Purge()方法可以解决问题?

Edit: Yup - seems to be: http://msdn.microsoft.com/en-us/library/ms703966%28VS.85%29.aspx 编辑:是的-似乎是: http : //msdn.microsoft.com/en-us/library/ms703966%28VS.85%29.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM