public bool sendSms(string cellNo, string sms) { string messages = null; messages = sms; if (this.serialPort.IsOpen == true) { try { this.serialPort.WriteLine("AT" + (char)(13)); Thread.Sleep(4); this.serialPort.WriteLine("AT+CMGF=1" + (char)(13)); Thread.Sleep(5); this.serialPort.WriteLine("AT+CMGS=\"" + cellNo + "\""); Thread.Sleep(10); this.serialPort.WriteLine(messages + (char)(26)); } catch (Exception ex) { MessageBox.Show(ex.Source); } return true; } else return false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)