Ejemplo n.º 1
0
 private void frmGetRemain_Shown(object sender, EventArgs e)
 {
     this.Visible = false;
     //判断是否为开机自启
     if (args == null)
     {
         this.Visible = true;
         return;
     }
     //判断网络是否正常
     while (!ClsTools.IsNetReady())
     {
         System.Threading.Thread.Sleep(60000);
     }
     if (Work())
     {
         frmNotice frmNoticeContral = new frmNotice();
         frmNoticeContral.Show();
     }
     else
     {
         //显示引导界面
         this.Visible = true;
         return;
     }
 }
Ejemplo n.º 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //更改按钮内容以提示
            btnOK.Text = "请稍后";
            //禁用按钮防止多点
            btnOK.Enabled = false;

            //禁用输入
            txtNumber.Enabled = false;
            txtPwd.Enabled    = false;

            //检查网络
            if (!ClsTools.IsNetReady())
            {
                MessageBox.Show("网络连接失败!");
                //更改按钮状态
                btnOK.Enabled     = true;
                txtNumber.Enabled = true;
                txtPwd.Enabled    = true;
                btnOK.Text        = "确认";
                return;
            }
            if (Work())
            {
                frmNotice frmNoticeContral = new frmNotice();
                frmNoticeContral.Show();
            }
        }