Exemplo n.º 1
0
        private void checkLink()
        {
            GetValues value  = new GetValues();
            string    com    = value.getPort();
            int       baud   = value.getBaud();
            int       timeot = value.getTimeout();

            serialPort1.PortName    = com;
            serialPort1.BaudRate    = baud;
            serialPort1.ReadTimeout = timeot;
            serialPort1.Open();
            if (serialPort1.IsOpen)
            {
                label1.Visible = true;
            }
            else
            {
                MessageBox.Show("Komunikacija sa modemom se ne može uspostaviti, molimo postavite novu konfiguraciju...!");
                this.Controls.Clear();
                SMSConfigPanel cfg = new SMSConfigPanel();
                cfg.Show();
                this.Controls.Add(cfg);
            }
            serialPort1.Close();
        }