I have an usb device (RF badge reader), and I need my application to detect for witch COM Port the device is plugged. what I`m doing now is like this:
SerialPort mySerialPort = new SerialPort("COM3");
mySerialPort.BaudRate = 9600;
mySerialPort.Parity = Parity.None;
mySerialPort.StopBits = StopBits.One;
mySerialPort.DataBits = 8;
mySerialPort.Handshake = Handshake.None;
mySerialPort.Open();
If I connect the device to another USB port, the application crashes. Any Idea how to do this ?