发送批量短信时遇到问题

问题描述:

我编写了一个使用GSM usb调制解调器发送短信的程序.
它只能发送第一个短信,但后续的短信不发送,即使您尝试一个一个发送短信,也只能发送第一个短信.

下面是发送过程;

I have written a program that sends sms using a GSM usb modem.
It''s able to send only the first sms but the subsequent does not go and even when you try to send them one by one, only the first one goes.

below is the send procedure;

private void btnSend_Click(object sender, EventArgs e)
{
    {
        if (this.port != null)
        {
            objclsSMS.ClosePort(this.port);
        }
        this.port = objclsSMS.OpenPort(this.cboPort.Text,
                                       Convert.ToInt32(this.cboBaudRate.Text),
                                       Convert.ToInt32(this.cboDataBits.Text),
                                       Convert.ToInt32(this.txtReadTimeOut.Text), 
                                       Convert.ToInt32(this.txtWriteTimeOut.Text));
        //.............................................. Send SMS ....................................................
        try
        {
            foreach (ListViewItem itemRow in this.LvwSMS.Items)
                {
                    for (int counter = 0; counter < itemRow.SubItems.Count; counter++)
                    {
                        //string MyText = itemRow.SubItems[counter].Text;
                        if (LvwSMS.Items[counter].Checked)
                        {
                            string name = LvwSMS.Items[counter].SubItems[1].Text;
                            string Tel = LvwSMS.Items[counter].SubItems[3].Text;
                            string Mess = LvwSMS.Items[counter].SubItems[2].Text;
                            objclsSMS.sendMsg(this.port, Tel, Mess);
                            MessageBox.Show("Send Next SMS!");
                        }
                    }
                }
        }
        catch (Exception ex)
        {
            //ErrorLog(ex.Message);
        }
    }



[edit]已添加代码块-OriginalGriff [/edit]



[edit]Code block added - OriginalGriff[/edit]



我想您正在重用本文演示的一些代码:

使用GSM调制解调器使用AT命令发送和读取SMS [ ^ ]

您是否尝试过:
Hi,

I guess you are reusing some code that is demonstrated in this article:

Send and Read SMS through a GSM Modem using AT Commands[^]

Have you tried stepping through :
public bool sendMsg(SerialPort port, string PhoneNo, string Message)



At命令之一可能返回错误.

AT命令及其使用简介 [



One of the At command is probably returning an error.

Introduction to AT commands and its uses[^]

Good luck.

Valery.