private void textBoxCom_TextChanged(object sender, EventArgs e) { if (start) { string str = textBoxCom.Text.Replace(" ", ""); Ini.Write("config", "com", str); if (serialPort1.IsOpen) { serialPort1.Close(); } //重新打开 open(); } }
private void textBox3_TextChanged(object sender, EventArgs e) { if (start) { string str = textBox3.Text.Replace(" ", ""); Ini.Write("config", "com1", str); if (serialPort2.IsOpen) { serialPort2.Close(); } //重新打开 Thread1(); } }