Esempio n. 1
0
        /// <summary>
        /// 获取临时素材(原下载媒体文件)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="mediaId"></param>
        /// <param name="stream"></param>
        public static void Get(string accessToken, string mediaId, Stream stream)
        {
            var url = string.Format("http://api.weixin.qq.com/cgi-bin/media/get?access_token={0}&media_id={1}",
                                    accessToken, mediaId);

            HTTPGet.Download(url, stream);
        }
        /// <summary>
        /// 获取二维码(不需要AccessToken)
        /// 错误情况下(如ticket非法)返回HTTP错误码404。
        /// </summary>
        /// <param name="ticket"></param>
        /// <param name="stream"></param>
        public static void ShowQrCode(string ticket, Stream stream)
        {
            var url = GetShowQrCodeUrl(ticket);

            HTTPGet.Download(url, stream);
        }