我使用zxing.net进行QR生成,但是在保存QR图像的同时,它替换了QR码的旧图像 我对QR码一无所知,所以有人可以帮我吗 我的代码捕捉是
var writer = new BarcodeWriter();
writer.Format = BarcodeFormat.QR_CODE;
var result= writer.Write(printArray[0]);
string path = Server.MapPath("/images/QRImage.jpg");
File.Copy(Server.MapPath("/images/QRImage.jpg"), Server.MapPath("/images/" + ComplaintId + ".jpg"), true);
var barcodeBitmap = new Bitmap(result);
using (MemoryStream memory = new MemoryStream())
{
using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite))
{
barcodeBitmap.Save(memory, ImageFormat.Jpeg);
byte[] bytes = memory.ToArray();
fs.Write(bytes, 0, bytes.Length);
}
}
string ImagePath = ComplaintId + ".jpg";
imgQRcode.Src = "~/images/" + ImagePath;
结果图像显示旧的QR图像