问题
I'm currently developing an SMS sender using C# (2010). The program does send the message but the message received was not the message sent, (i.e " yt+ 35") and while running the program several times, the received message do not contain anything at all, even the senders number.
I am using a GSM modem and COM port for sending.
Any idea what I am missing here?
Code found in the Class:
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;
来源:https://stackoverflow.com/questions/32025084/c-sharp-sms-sender-thru-modem