示例#1
0
 private void button4_Click(object sender, EventArgs e)
 {
     IPGW.saveUserInfo(userName.Text, passWord.Text);
     IPGW.IPGW_connect(IPGW.DIS_ALL, this.userName.Text, this.passWord.Text);
     MessageBox.Show(IPGW.parseCode[IPGW.lastResultCode]);
     if (thread.IsAlive)
     {
         thread.Abort();
     }
     this.connInfo.Hide();
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            IPGW.saveUserInfo(userName.Text, passWord.Text);
            var isSuc = IPGW.IPGW_connect(IPGW.FREE, this.userName.Text, this.passWord.Text);

            if (isSuc)
            {
                this.WindowState = FormWindowState.Minimized;
                this.notifyIcon1.ShowBalloonTip(1000, "提示", "连接免费网络成功", ToolTipIcon.Info);
            }
            else
            {
                MessageBox.Show(IPGW.parseCode[IPGW.lastResultCode]);
            }
            if (thread.IsAlive)
            {
                thread.Abort();
            }
            this.connInfo.Hide();
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            IPGW.saveUserInfo(userName.Text, passWord.Text);
            bool isSuc = IPGW.IPGW_connect(IPGW.GLOBAL, this.userName.Text, this.passWord.Text);

            if (isSuc)
            {
                this.WindowState = FormWindowState.Minimized;
                this.notifyIcon1.ShowBalloonTip(1000, "提示", IPGW.parseCode[IPGW.lastResultCode], ToolTipIcon.Info);
            }
            else
            {
                MessageBox.Show(IPGW.parseCode[IPGW.lastResultCode]);
            }
            if (!isSuc)
            {
                return;
            }
            this.connInfo.Hide();
            if (this.checkBox1.Checked)
            {
                if (thread.IsAlive)
                {
                    thread.Abort();
                }
                thread = new Thread(Func);
                thread.Start();
            }
            else
            {
                if (thread.IsAlive)
                {
                    thread.Abort();
                }
                this.connInfo.Hide();
            }
        }