示例#1
0
文件: Form1.cs 项目: xiaojuntang/MQ
        private void button1_Click(object sender, EventArgs e)
        {
            UserInfo u = new UserInfo();
            u.UserID = index++;
            u.UserName = "******" + textBox1.Text + index;
            MQHelper.SendMessage(u, typeof(UserInfo), MsgTypeEnum.UserMsg);

            LogInfo l = new LogInfo();
            l.LogID = index;
            l.LogName = "日志" + textBox1.Text + index;
            MQHelper.SendMessage(l, typeof(LogInfo), MsgTypeEnum.LogMsg);
        }
示例#2
0
文件: Program.cs 项目: xiaojuntang/MQ
        static void Main(string[] args)
        {
            for (int i = 0; i < 100; i++)
            {
                UserInfo u = new UserInfo();
                u.UserID = i;
                u.UserName = "******"+i;
                MQHelper.SendMessage(u, typeof(UserInfo), MsgTypeEnum.UserMsg);
            }

            for (int i = 0; i < 100; i++)
            {
                LogInfo u = new LogInfo();
                u.LogID = i;
                u.LogName = "姓名" + i;
                MQHelper.SendMessage(u, typeof(LogInfo), MsgTypeEnum.LogMsg);
            }
            Console.WriteLine("完毕");
            Console.ReadLine();
        }