public static void Close() { if (reader != null) { reader.OnMessageNotificationReceived -= new Invengo.NetAPI.Core.MessageNotificationReceivedHandle(reader_OnMessageNotificationReceived); reader.Disconnect(); } }
// 断开连接 private void btnDisconn_Click(object sender, EventArgs e) { if (reader != null) { reader.OnMessageNotificationReceived -= new Invengo.NetAPI.Core.MessageNotificationReceivedHandle(reader_OnMessageNotificationReceived); reader.Disconnect(); } changeCtrlEnable("disconn"); lblMsg.Text = "断开连接"; }
private void btn_Disconnect_Click(object sender, EventArgs e) { if (reader != null) { reader.OnMessageNotificationReceived -= new Invengo.NetAPI.Core.MessageNotificationReceivedHandle(reader_OnMessageNotificationReceived); reader.Disconnect(); btn_Disconnect.Enabled = false; btn_Connect.Enabled = true; btn_ReadEPC.Enabled = false; changeCtrlEnable("disconn"); // MQTT Disconnect client.Disconnect(); } lbl_msg.Text = "disconn"; }