Beispiel #1
0
        private async Task Start_Link()
        {
            pictureBox2.Hide();
            bool link_result = Server_Start();

            if (link_result)
            {
                button6.Image     = images_Res.加速_进行时;
                pictureBox1.Image = images_Res.加速_初始;
                Auto_ChangePicBoxSize();
                Auto_class.Delay(1750);
                label1.Text       = "云节点部署中";
                pictureBox1.Image = images_Res.加速_等待判断状态;
                //判断是否成功链接
                bool Check_Result = await Check_Link_State(5);

                if (Check_Result)
                {
                    pictureBox1.Image = images_Res.加速_善后;
                    Auto_class.Delay(1600);
                    pictureBox1.Image = images_Res.加速_成功;
                    Common.Is_Linked  = true;
                    Timer_Link_Date   = new System.Threading.Timer(Timer_Event, null, 0, 1000);
                    TimeNow           = DateTime.Now;
                    label1.Text       = Common.Servers_Region + "云节点加速中";
                }
                else
                {
                    link_State.Text = "无法连接到服务器,请稍后重试";
                    Auto_class.Delay(1500);
                    Closure_Link();
                }
            }
            else
            {
                Closure_Link();
            }
        }