private void ShowQRImage()
        {
            string str = "bind" + DateTime.Now.ToString("yyyyMMddHHmmss");

            try
            {
                QrcodeInfo info2 = new QrcodeInfo {
                    codeType     = "TEMP",
                    showLogo     = "Y",
                    expireSecond = 600
                };
                codeInfo info3 = new codeInfo();
                scene    scene = new scene {
                    sceneId = str
                };
                info3.scene    = scene;
                info2.codeInfo = info3;
                QrcodeInfo codeInfo = info2;
                this.hiddSceneId.Value = str;
                AlipayMobilePublicQrcodeCreateResponse response = AliOHHelper.QrcodeSend(codeInfo);
                if ((response != null) && (response.Code == 200L))
                {
                    this.imgQRCode.ImageUrl = response.CodeImg;
                }
                else
                {
                    this.imgQRCode.AlternateText = "未成功获取服务窗授权";
                }
            }
            catch (Exception exception)
            {
                AliOHHelper.log(exception.Message);
            }
        }
예제 #2
0
        private void ShowQRImage()
        {
            string text = "bind" + System.DateTime.Now.ToString("yyyyMMddHHmmss");

            try
            {
                QrcodeInfo codeInfo = new QrcodeInfo
                {
                    codeType     = "TEMP",
                    showLogo     = "Y",
                    expireSecond = 600,
                    codeInfo     = new codeInfo
                    {
                        scene = new scene
                        {
                            sceneId = text
                        }
                    }
                };
                this.hiddSceneId.Value = text;
                AlipayMobilePublicQrcodeCreateResponse alipayMobilePublicQrcodeCreateResponse = AliOHHelper.QrcodeSend(codeInfo);
                if (alipayMobilePublicQrcodeCreateResponse != null && alipayMobilePublicQrcodeCreateResponse.Code == 200L)
                {
                    this.imgQRCode.ImageUrl = alipayMobilePublicQrcodeCreateResponse.CodeImg;
                }
                else
                {
                    this.imgQRCode.AlternateText = "未成功获取服务窗授权";
                }
            }
            catch (System.Exception ex)
            {
                AliOHHelper.log(ex.Message);
            }
        }