C#添加二维码带加密带logo

2021-06-11 18:07

阅读:533

标签:[]   server   tin   accept   map   contex   settings   field   logo   

#region 生成QR码,加密与logo在此处修改
        public static void CreateQr(string strQrContent, DataTable myTable)
        {
            Qr q = new Qr();
            byte[] bylogo = null;
            //加密?
            //logo
            if (ConfigurationManager.AppSettings.AllKeys.Contains("Logo") && ConfigurationManager.AppSettings["Logo"] != null)
            {
                string strLogoFileName = ConfigurationManager.AppSettings["Logo"];
                FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(string.Format("~/res/images/logo/{0}", strLogoFileName)));
                Bitmap bmp = new Bitmap(file.FullName);
                MemoryStream m = new MemoryStream();
                bmp.Save(m, ImageFormat.Jpeg);
                bylogo = m.GetBuffer();
            }
            myTable.Columns.Add(LY_QR_TABLE.QRCODE_FIELD, typeof(System.Byte[]));
            byte[] byqr = q.GetQr(strQrContent, bylogo);
            myTable.Rows[0][LY_QR_TABLE.QRCODE_FIELD] = byqr;
            myTable.AcceptChanges();
        }

 

C#添加二维码带加密带logo

标签:[]   server   tin   accept   map   contex   settings   field   logo   

原文地址:https://www.cnblogs.com/wangjp-1233/p/10548930.html


评论


亲,登录后才可以留言!