コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (portNameComboBox.SelectedItem == null || BaudRateComboBox.SelectedItem == null || phoneNumTextBox.Text =="")
            {
                MessageBox.Show("��ѡ��˿ںͲ����ʣ��������ֻ����ţ�");
                return;
            }

            Moden md = new Moden();
            md.PortName = (string)portNameComboBox.SelectedItem;
            md.BaudRate = int.Parse((string)BaudRateComboBox.SelectedItem);
            md.DtrEnable = true;
            md.ReadBufferSize = 1024;
            md.ReadTimeout = 120 * 1000;
            md.RtsEnable = true;

            th = new MainThread(phoneNumTextBox.Text.Trim(),md, this);
            ThreadPool.QueueUserWorkItem(th.run);

            changeThreadState("������...");
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (portNameComboBox.SelectedItem == null || BaudRateComboBox.SelectedItem == null || phoneNumTextBox.Text == "")
            {
                MessageBox.Show("请选择端口和波特率,并填入手机卡号!");
                return;
            }

            Moden md = new Moden();

            md.PortName       = (string)portNameComboBox.SelectedItem;
            md.BaudRate       = int.Parse((string)BaudRateComboBox.SelectedItem);
            md.DtrEnable      = true;
            md.ReadBufferSize = 1024;
            md.ReadTimeout    = 120 * 1000;
            md.RtsEnable      = true;

            th = new MainThread(phoneNumTextBox.Text.Trim(), md, this);
            ThreadPool.QueueUserWorkItem(th.run);


            changeThreadState("运行中...");
        }