zoukankan      html  css  js  c++  java
  • asp.net生成二维码的方法

    asp.net生成二维码的方法 

    [复制链接]
     
    这个要利用一个Dll文件。

    如下
     Gma.QrCodeNet.Encoding.dll (105.5 KB, 下载次数: 27) 
    当然大家也可以直接下载使用


    生成的方法很简单, 直接生成

    [C#] 纯文本查看 复制代码
    01
    02
    03
    04
    05
    06
    07
    08
    09
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    /// <summary>
    /// QcImage 的摘要说明
    /// </summary>
    public class QcImage : IHttpHandler
    {
     
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "image/png";
            QrEncoder qrEncoder = new QrEncoder(ErrorCorrectionLevel.Q);
            var content = "这里写内容就行了";
            QrCode qrCode = qrEncoder.Encode(content);
            DrawingBrushRenderer dRenderer = new DrawingBrushRenderer(new FixedModuleSize(6, QuietZoneModules.Zero));
            MemoryStream ms = new MemoryStream();
            dRenderer.WriteToStream(qrCode.Matrix, ImageFormatEnum.PNG, ms);
            context.Response.BinaryWrite(ms.ToArray());
        }
     
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
  • 相关阅读:
    hdu 4474 转化为bfs + 一个巧妙的剪枝~
    数据结构几类排序的总结和完整代码 待续。。
    poj 2135 Farm Tour
    hdu 4374 (单调队列+dp)
    poj2391 Ombrophobic Bovines 拆点连边要注意
    hdu3507
    hdu1506
    poj2175
    poj3308
    poj3155 Hard Life
  • 原文地址:https://www.cnblogs.com/skyay/p/5028467.html
Copyright © 2011-2022 走看看