private MsmqBaseOperator(string machineName, string queueName, QueueAccessMode accessMode, EncryptionRequired encryptionRequired = EncryptionRequired.None) { string msmqName = MsmqHelper.CreateMsmqQueueName("", queueName, "", machineName); EnsureQueueExists(msmqName); var queueCounter = new PerformanceCounter( "MSMQ Queue", "Messages in Queue", msmqName, machineName); this.Queue = new MessageQueue(msmqName, accessMode); this.Queue.EncryptionRequired = encryptionRequired; Queue.Formatter = new XmlMessageFormatter(new Type[] { typeof(MsgType) }); if (!MessageQueue.Exists(this.Queue.Path)) { MessageQueue.Create(this.Queue.Path); } }
public SendStringToMsMessageQueue(string queueName) { msmqQueue = MsmqHelper.GetMsmqQueue(MsmqHelper.CreateMsmqQueueName("", queueName, "")); }