RabbitMQ发送消息
ConnectionFactory factory = new ConnectionFactory { HostName = "localhost", Port = 5672, UserName = "admin",Password = "ADMIN", VirtualHost = "admin" };
using (IConnection conn = factory.CreateConnection())
{
using (IModel im = conn.CreateModel())
{
im.QueueDeclare(queue: "admin",
durable: false,
exclusive: false,
autoDelete: false,
arguments: null);
string message = textBox1.Text;
var sendMessage = Encoding.UTF8.GetBytes(message);
im.BasicPublish(exchange: "",
routingKey: "admin",
basicProperties: null,