示例#1
0
 /// <summary>
 /// 后台进行自动重连
 /// </summary>
 public void ReConnect()
 {
     try
     {
         if (ConnectHelp.isConencting)
         {
             return;
         }
         ConnectHelp.isConencting = true;
         SetNewInfo("网络异常,正在重连中,请稍候...", false);
         //ConnectHelp.wcdma_procwnd = new HT380_WCDMA_PROCWND(this);
         ConnectHelp.G3_UnConnect();
         ConnectHelp.Connnet();
     }
     catch (Exception ex)
     {
         SetNewInfo(ex.Message, false);
     }
 }
示例#2
0
        //private void lbGprs_GotFocus(object sender, EventArgs e)
        //{
        //    lbGprs.GotFocus -= new EventHandler(lbGprs_GotFocus);
        //    EnableNoButton();
        //    //Thread th = new Thread(DoTestPing);
        //    //th.IsBackground = true;
        //    //th.Start();

        //}

        private void btnConnect_Click(object sender, EventArgs e)
        {
            try
            {
                EnableNoButton();
                if (ConnectHelp.isConencting)
                {
                    VirtualConsole(false, "后台正在自动重连中,无需手动拨号", 0);
                    return;
                }
                ConnectHelp.i_type        = i_type;
                ConnectHelp.wcdma_procwnd = new HT380_WCDMA_PROCWND(this);
                VirtualConsole(true, "正在下电...请稍候!", 0);
                ConnectHelp.G3_UnConnect();
                //开启GPRS模块
                VirtualConsole(false, "正在上电及拨号,请稍候...", 0);
                int ret = ConnectHelp.Connnet();
                //if (ret == -4)
                //{
                //    VirtualConsole(false, "串口通讯失败", 0);
                //    EnableNoButton();
                //}
                //else if (ret == 1)
                //{
                //    VirtualConsole(false, "已连接到网络", 0);
                //}
            }
            catch (Exception ex)
            {
                VirtualConsole(false, ex.Message, 0);
            }
            finally
            {
                EnableYesButton();
            }
        }