private void button6_Click(object sender, EventArgs e) { if (Test != null) { Test.Close(); Test = null; } }
private void btnNew_Click(object sender, EventArgs e) { if (Test == null) { //Test = new SimpleTCPIPClient("192.168.1.112", 8888, "ThomasPeng"); Test = new TCPIPClient("127.0.0.1", 2000, "ThomasPeng"); Test.Start(); } else { MessageBox.Show("You already opened the client station."); } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (excl != null) { excl.Dispose(); } excl = null; if (mmm != null) { mmm.Dispose(); } mmm = null; if (RSPort != null) { RSPort.ClosePort(); } RSPort = null; bb = null; cc = null; if (xxxx != null) { xxxx.Close(); } xxxx = null; if (ww != null) { ww.Dispose(); } ww = null; if (Test != null) { Test.Close(); } Test = null; ReadData = null; //ll.Close(); }