Ejemplo n.º 1
0
        /// <summary>
        /// 创建商家二维码
        /// </summary>
        /// <param name="XShow"></param>
        /// <returns></returns>
        public ActionResult CreateQRCode(string XShow)
        {
            string shopUrl = string.Empty;

            if (CurrentInfo.GetCurrentShopType() == ShopTypeEnum.美容美发)//美容美发显示奇策,奇策的显示美容美发的
            {
                shopUrl = "http://www.bbbb4.com/home/jkxt/?XShow=" + XShow;
            }
            else
            {
                shopUrl = "http://mf.iqcrj.com/homemeifa/jkxt/?XShow=" + XShow;
            }

            QRCodeHelper qrCode = new QRCodeHelper();
            Bitmap       qrImg  = qrCode.Create(shopUrl, 12);
            MemoryStream ms     = new MemoryStream();

            qrImg.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
            byte[] bytes = ms.GetBuffer();
            return(File(bytes, @"image/jpeg"));
        }