hi - I open a serial port on a windows form using the following code:
if (port == null)
port = new SerialPort(selectedPortName, 19200, Parity.None, 8, StopBits.One); //Com Port and Default Baud Rate
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
if I close the form and then reopen it, the code for the creation of the port is called again. when it is, it throws an access error. ("Access to the port 'COMxx' is denied.") is there an easy way to check whether the port has been configured once and doesn't need it again?