C# SMS Sender Thru Modem

杀马特。学长 韩版系。学妹 提交于 2020-01-25 11:38:12

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!