Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private void btnRS232C_Click(object sender, EventArgs e)
 {
     RSPort = new RS232Comm("ThomasPeng", ref this.richTextBox2);
     RSPort.OpenPort(1);
 }