本文介绍了查找队列状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我是System.Messaging的新手,有人可以让我知道如何在计算机中查找队列的状态吗,说我需要,
-状态{Active,Inactive,NoAccess}
Hi All,
I am new to System.Messaging, can any one let me know how to find the status of a queue in the machine, say I need,
- Status {Active, Inactive, NoAccess}
MessageQueue[] mq = MessageQueue.GetPrivateQueuesByMachine(".");
foreach (var item in mq)
{
//- Result: List of private queues and transactional DLQ mit properties:
// - Name
// - Type {Productive, Poison, DeadLetter}
// - Status {Active, Inactive, NoAccess
// - MessageCount
Console.WriteLine(string.Format("{0}{1}{2}{3}{4}{5}",
"Queue Name:", item.QueueName,
"Count:", item.GetAllMessages().Length,
"Status:", ??????????)); }
这就是我编写的代码,我的目标是3.5 .NET Framework.
提前谢谢.
问候,
Srini.
This is what I have coded, I am targeting 3.5 .NET Framework.
Thanks in advance.
regards,
Srini.
推荐答案
这篇关于查找队列状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!