把链接生成二维码,代码如下:
public void ResImg() { string contents = "http://www.baidu.com"; Bitmap bmp = GeneratorQrImage(contents); MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] arr = new byte[ms.Length]; ms.Position = 0; ms.Read(arr, 0, (int)ms.Length); ms.Close(); Response.Clear(); Response.ContentType = "image/gif"; Response.OutputStream.Write(arr, 0, arr.Length); Response.End(); }
原文地址:https://www.cnblogs.com/Iven-zhang/p/10163208.html
时间: 2024-10-25 00:01:09