Ejemplo n.º 1
0
        private void Btn_getLoginQrcode_Click(object sender, EventArgs e)
        {
            ResponseBase <LoginQrcodeResponse> ResponseModel = new ResponseBase <LoginQrcodeResponse>();
            LoginQrCodeRequest RequestModel = new LoginQrCodeRequest();

            RequestModel.DeviceId      = this.tb_decid.Text;
            RequestModel.ProxyIp       = Common.ProxyConfig.Ip;
            RequestModel.ProxyUserName = Common.ProxyConfig.UserName;
            RequestModel.ProxyUserName = Common.ProxyConfig.UserPwd;



            if (!loginFacade.LoginByQrcode(ref ResponseModel, RequestModel))
            {
                SetTextBox(loginFacade.Msg, this.tb_log);
                return;
            }

            Image qrcode = Helper.ImageHelper.resizeImage(Helper.ImageHelper.Base64StringToImage(ResponseModel.Data.QrBase64), 280, 280);

            this.pic_qrcode.Image = qrcode;
            SetTextBox("Uuid:", tb_log);
            SetTextBox(ResponseModel.Data.Uuid, tb_log);
            SetTextBox("过期时间:", tb_log);
            SetTextBox(ResponseModel.Data.ExpiredTime, tb_log);
            this.lb_uuid.Text = ResponseModel.Data.Uuid;


            Timer_CheckLogin.Elapsed += Timer_CheckLogin_Elapsed;
            Timer_CheckLogin.Interval = 2000;
            Timer_CheckLogin.Start();
        }
Ejemplo n.º 2
0
        public bool LoginByQrcode(ref ResponseBase <LoginQrcodeResponse> ResponseModel, LoginQrCodeRequest RequestModel)
        {
            string url     = AppConfig.BaseUrl + AppConfig.Login_GetQrCode;
            string posData = JsonConvert.SerializeObject(RequestModel);

            ResponseModel = PostByJson <LoginQrcodeResponse>(url, posData);

            return(ResponseModel.Success);
        }