Esempio n. 1
0
 private void 水浴箱控制ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Global.client is MqttClient)
     {
         var form = new FormControl();
         ChangeForm(form);
     }
     else
     {
         MessageBox.Show("请先登录");
     }
 }
Esempio n. 2
0
        private void LoginToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string[] subTopics = { Global.subTopic };
            byte[]   qosLevels = { MqttMsgBase.QOS_LEVEL_AT_MOST_ONCE };
            Global.client = new MqttClient("118.89.106.236");
            Global.client.Connect(Guid.NewGuid().ToString(), "tester2", "tester");
            Global.client.Subscribe(subTopics, qosLevels);
            progressBar1.Value = 100;
            var form = new FormControl();

            ChangeForm(form);
        }