public clsPortManager() { clsFileHandling fh = new clsFileHandling(); string port = "COM6"; port = fh.FileRead(fh.GetDirectory(), 0); sp = new SerialPort(port, 9600); }
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(); }