public void ClosePort() { if ((Modem != null)) { Modem.Dispose(); Modem = null; } }
public void PortLoad(string port) { try { //add reference muna, add mo yung smscore Modem = new SMSComm(port); //ilagay dito yung com port Modem.doE += Application.DoEvents; Modem.MessageReceived += NewMessageReceivedEvent; Control.CheckForIllegalCrossThreadCalls = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }