ASP.NET实现二维码(QRCode)的创建和读取实例(5)

Image image;
                String data = txt_qr;
                image = qrCodeEncoder.Encode(data);
                filename = Guid.NewGuid().ToString() + ".jpg";
                filepath = context.Server.MapPath(@"~\Utilty\QRCode\upload") + "\\" + filename;
                System.IO.FileStream fs = new System.IO.FileStream(filepath, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write);
                image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);
                fs.Close();
                image.Dispose();
                context.Response.Write("[{\"count\":1,\"list\":[{\"imgurl\":\"upload/" + filename + "\"}]}]");

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjzzzj.html