Example #1
0
        /// <summary>
        /// 生成md5校验值
        /// </summary>
        /// <param name="parameterString">参数字符串</param>
        /// <returns></returns>
        public static string GetMD5String(string parameterString)
        {
            string MD5Key = Auxiliary.ConfigKey("MD5Key");

            string MD5String = CommonMd5Encrypt(Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(parameterString + MD5Key)));


            return(MD5String);
        }
Example #2
0
 private ActiveMq()
 {
     try
     {
         //创建工厂
         factory = new ConnectionFactory(Auxiliary.ConfigKey("MQAddress"));
         //创建连接
         connection = factory.CreateConnection();
     }
     catch (Exception ex)
     {
         LogHelper.Error("单例ActiveMQ连接错误:" + ex.Message);
     }
 }
Example #3
0
        public OpenSearchMessage()
        {
            string queueName   = "";
            string mqIpaddress = Auxiliary.ConfigKey("OpenSearchMQIPAddress");
            string mqname      = Auxiliary.ConfigKey("OpenSearchMQName");

            if (mqIpaddress != ".")
            {
                //本机
                queueName = "FormatName:Direct=TCP:" + mqIpaddress + "\\private$\\" + mqname;
            }
            else
            {
                queueName = ".\\private$\\" + mqname;
            }
            mesqueue = new MessageQueue(queueName);
        }
Example #4
0
        /// <summary>
        /// 创建消息队列
        /// </summary>
        public SendMessage()
        {
            string queueName = "";

            string mqIpaddress = Auxiliary.ConfigKey("MQIpAddress");
            string mqname      = Auxiliary.ConfigKey("MQName");

            if (mqIpaddress != ".")
            {
                //本机
                queueName = "FormatName:Direct=TCP:" + mqIpaddress + "\\private$\\" + mqname;
            }
            else
            {
                queueName = ".\\private$\\" + mqname;
            }
            mesqueue = new MessageQueue(queueName);
            // mesqueue.SetPermissions("Everyone", MessageQueueAccessRights.FullControl);
        }