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(); } } }