void RFIDHelper_evtWriteToSerialPort(byte[] value) { if (comport == null) { return; } try { if (!comport.IsOpen) { ConfigManager.SetSerialPort(ref comport); comport.Open(); } comport.Write(value, 0, value.Length); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }