GSMComm多个调制解调器连接c#

时间:2012-04-25 06:34:27

标签: c# gsm modem

我在使用GSMComm连接无限调制解调器时遇到问题..

有人可以举例说明怎么做?

这是我的代码,但它不起作用..

GsmCommMain gsm;

private void btnConAllDev_Click_1(object sender, EventArgs e)
    {
        try
        {
            for (int i = 0; i < lvDeviceRegistered.Items.Count; i++)
            {
                         //GSMCommMain(PORTName,Baudrate,Timeout)
                         //i got it from  listview

                gsm = new GsmCommMain(lvDeviceRegistered.Items[i].SubItems[2].Text, int.Parse(lvDeviceRegistered.Items[i].SubItems[3].Text), int.Parse(lvDeviceRegistered.Items[i].SubItems[4].Text));
                gsm.Open();


                MessageBox.Show(gsm.IdentifyDevice().Manufacturer + " is now connected with PORT " + gsm.PortName , "Information");


               // cmbProvider.Items.Add(gsm.GetCurrentOperator().TheOperator);
            }
        }
        catch (Exception x)
        {

            MessageBox.Show("Modem/Phone with PORT " + gsm.PortName + " Can't connect!", "Connection Error");
        }
    }

我在循环中遇到问题,总是得到连接的最后一个循环值。我无法获得第一个价值..

提前致谢

0 个答案:

没有答案