Пример #1
0
        public clsPortManager()
        {
            clsFileHandling fh   = new clsFileHandling();
            string          port = "COM6";

            port = fh.FileRead(fh.GetDirectory(), 0);
            sp   = new SerialPort(port, 9600);
        }
Пример #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            clsFileHandling fh   = new clsFileHandling();
            string          port = lbxCOMPortList.SelectedItem.ToString();

            fh.FileWrite(fh.GetDirectory(), port);

            MessageBox.Show("The system needs to exit to apply the changes. Click OK to continue?", "Exit", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            Application.Exit();
        }