首页 > 代码库 > WCF 删除队列

WCF 删除队列

Configuration config = ConfigurationManager.OpenExeConfiguration                (ConfigurationUserLevel.None);            ServiceModelSectionGroup  group=ServiceModelSectionGroup.GetSectionGroup(config);            foreach(ChannelEndpointElement endPoint in group.Client.Endpoints )            {                if (endPoint.Binding == "netMsmqBinding")                {                    string queuename = GetQueueFromUri(endPoint.Address);                    if (MessageQueue.Exists(queuename) == false)                    {                        MessageQueue queue = new MessageQueue(queuename);                        queue.Purge();                    }                }            }

image

WCF 删除队列