示例#1
0
 private void Connect(VPNInfoEntity entity)
 {
     notifyIcon1.ShowBalloonTip(3000, "...", "正在尝试连接:" + entity.Ip, ToolTipIcon.Info);
     VPNConnectHelper.DialAsyncComplete -= VPNConnectHelper_DialAsyncComplete;
     VPNConnectHelper.DialAsyncComplete += new VPNConnectHelper.DialAsyncCompleteHandler(VPNConnectHelper_DialAsyncComplete2);
     VPNConnectHelper.DialAsync(entity.Ip, entity.User, entity.Pwd);
 }
示例#2
0
        private void FindNext()
        {
            if (!findFlag)
            {
                return;
            }

            currTryIdx++;
            if (gd1.Rows.Count > currTryIdx && !gd1.Rows[currTryIdx].IsNewRow)
            {
                DataGridViewRow row    = gd1.Rows[currTryIdx];
                VPNInfoEntity   entity = (VPNInfoEntity)gd1.Rows[currTryIdx].DataBoundItem;
                if (entity.Ping > 0)
                {
                    currTryVPNInfoEntity = entity;
                    VPNConnectHelper.DialAsync(entity.Ip, entity.User, entity.Pwd);
                }
                else
                {
                    FindNext();
                }
            }
            else
            {
                notifyIcon1.ShowBalloonTip(5000, "...", "以搜索到列表尾!", ToolTipIcon.Info);
            }
        }
示例#3
0
 void btnStop_Click(object sender, EventArgs e)
 {
     ChangeBtnFind();
     findFlag = false;
     VPNConnectHelper.CancelDialAsync();
     btnPing.Enabled = true;
 }
示例#4
0
 private void btnDisconnect_Click(object sender, EventArgs e)
 {
     findFlag = false;
     VPNConnectHelper.Disconnect();
 }