Ejemplo n.º 1
0
        /// <summary>
        /// 传入ExpireSeconds,ActionName,ActionInfo(sceneId)。获取临时二维码,返回二维码图片文件的服务器地址。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static Stream GetTempQrCode(CreateQrCode msg)
        {
            msg.ActionName = EnumHelper.QrCodeType.QR_SCENE.ToString();
            var result = HttpHelper.Post <QrResult>(ApiList.QrcodeCreateUrl, msg.ToString(), "access_token=" + Token.GetAccessToken(msg));
            var url    = ApiList.ShowQrcodeUrl + "?ticket=" + result.Ticket + "&access_token=" + Token.GetAccessToken(msg);
            var stream = HttpHelper.GetStream(url, "");

            return(stream);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 传入ActionName,ActionInfo(scene_id对应QR_LIMIT_SCENE,scene_str对应QR_LIMIT_STR_SCENE)
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public Stream GetEverQrCode(CreateQrCode msg)
        {
            var result = HttpHelper.Post <QrResult>(ApiList.QrcodeCreateUrl, msg.ToString(),
                                                    "access_token=" + Token.GetAccessToken(msg));
            var url    = ApiList.ShowQrcodeUrl + "?ticket=" + result.Ticket + "&access_token=" + Token.GetAccessToken(msg);
            var stream = HttpHelper.GetStream(url, "");

            return(stream);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 创建二维码。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static QrCodeResult CreateTempQrCode(CreateQrCode msg)
        {
            var result = HttpHelper.Post <QrCodeResult>(new HttpParam()
            {
                Url       = ApiList.QrcodeCreateUrl,
                PostParam = msg.ToJsonString(),
                GetParam  = "access_token=" + TokenHelper.GetAccessToken()
            });

            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 传入ActionName,ActionInfo(scene_id对应QR_LIMIT_SCENE,scene_str对应QR_LIMIT_STR_SCENE)
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static Stream GetEverQrCode(CreateQrCode msg)
        {
            msg.ActionName = EnumHelper.QrCodeType.QR_LIMIT_STR_SCENE.ToString();
            var result = HttpHelper.Post <QrCodeResult>(
                new HttpParam()
            {
                Url =
                    ApiList.QrcodeCreateUrl,
                PostParam = msg.ToJsonString(),
                GetParam  = "access_token=" + TokenHelper.GetAccessToken()
            });
            var url    = ApiList.ShowQrcodeUrl + "?ticket=" + result.Ticket + "&access_token=" + TokenHelper.GetAccessToken();
            var stream = HttpHelper.GetStream(url);

            return(stream);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 创建二维码。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static QrResult CreateTempQrCode(CreateQrCode msg)
        {
            var result = HttpHelper.Post <QrResult>(ApiList.QrcodeCreateUrl, msg.ToString(), "access_token=" + Token.GetAccessToken(msg));

            return(result);
        }